Consulting

Results 1 to 8 of 8

Thread: Advice needed - Voting Program in PowerPoint and write results to Excel?

  1. #1

    Advice needed - Voting Program in PowerPoint and write results to Excel?

    I'm looking for some general advice on how to proceed with a project. A little background first. I've done a lot of programming in Excel and Access with VBA and a little SQL too. I'm also a fairly advanced PowerPoint developer, but I haven't ventured into VBA programming with PowerPoint... yet.

    I work at an Elementary School and I'd like to develop a voting program where students can vote for their school officers. What I would like to do, but I'm not sure it's possible, is use PowerPoint where there are pictures of candidates on a slide and when a student clicks on a picture it "writes" the data to an Excel spreadsheet (or other place that can compile and hold the data) as students are voting. Basically, counting the number of clicks for each candidate. I have no idea if this is possible in PowerPoint... to write data real-time to Excel. If it is, I'll start down the road of developing it, but maybe it should be done in Access using forms or another program. The reason I'm hoping it can be done in PowerPoint is that it will be more easily editable if others with less programming experience want to use it and edit it... we often share tools we've developed between schools. Whatever software is used, the program cannot be done using a web based solution as we are not aloud to put student pictures with names online.

    Just to give a few more specifics on how the program would run (if possible). After an opening slide (something like "Click here to begin voting") there would be one slide for each office. The first slide would have pictures and names of all the candidates for President. When a student clicks on the candidate they want for President, it would take them to the next slide of Vice President, etc. When a student has been through all the slides/offices, it would go back to an opening slide where the next student could start voting and go through the slides/offices again. On the computer where this is installed, when a picture is clicked it would add 1 to the total for the candidate that was selected...hopefully in Excel... again, if this is even possible. If the data could be written to a text file that would work also, but Excel would be better obviously.

    Any advice is appreciated. I just didn't want to spend an inordinate amount of time trying to develop something that isn't possible. If you have an idea of another program to use to develop this, I'm open to that also.

    Hope this made sense.

    Thanks,
    Carolyn

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Q: Multiple students voting simultaneously each with PP open on their PC and writing to a single instance workbook on a server(?)

    or


    Q: A voting booth paradigm where students queue and take turns at a single instance of PP?
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    Hi Paul,
    It could be either, but I think for now the second option is what I'm thinking of... where students would be in line basically to vote at the same computer... so the PowerPoint would loop back to the beginning when one student finished voting and the PowerPoint would be ready for another student to go through it again. The data would be written locally to that computer (not a server).

    Your first option would probably be better, but I think for right now... writing to a workbook on the local computer is best.

    Do you think this is possible... to do?

    Thanks,
    Carolyn

    Does this make sense?

  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    IMO, Option 2 is much easier.

    IM-inexperienced-O, Option1 would require writing to Access, then exporting the result to Excel. Or Word or ???


    On third thought, if PP has Class Modules, A CM can hold all a Student's choices and pass them to a single Networked Excel CM. The xlCM would need a Ready Property and the ppCM would need to wait for a Ready from the xlCM. Since the likelihood of two or more students finishing at exactly the same millisecond is very low, there should be no problem. I have written xlCMs that operate in microseconds with large Arrays
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  5. #5
    Hi SamT,

    Thank you for your response, but I think your solution (PP Class Modules) is going to be above of my level of expertise. I have a cursory understanding of your explanation, but I don't think enough to design and implement.

    Not sure if you would be willing to explain with a bit more detail about your response to Option 1 about "writing to Access." I would need a little more information if that's possible in this forum/setting.

    Lastly, I'll just ask... am I trying to do this (create a voting program) in the wrong application? Maybe it's really not feasible to do it in PowerPoint?

    Thanks again for your response.

    Carolyn

  6. #6
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Carolyn,

    I have no experience with PowerPoint and very little with Access.

    I do see that a few PP and Access experts are following this thread. Perhaps some of them will contribute.

    One possible algorithm for an Excel interface could resemble

    Declare Votes As Dictionary
    Fill Votes Keys with Teacher Names

    Property Let VoteFor(TeacherName As String)
    Votes.TeacherName.Item = Item + 1
    End Property

    Public Procedure EndVoting()
    Export Sum of all Vote.Keys and .Items to Excel
    End Procedure
    PP would use this like
    Dim Exl As Application, etc
    Set Exl = Networked Excel Workbook with Class Module (Edit: or ThisWorkbook Code)
    On TeacherImage.Click...
    Exl.CMName.VoteFor TeacherName
    And
    Exl.CMName.EndVoting
    In Fact, THisWorkbook is a Class Module, so it could take that code, then PP's output could be
    Exl.VoteFor TeacherName
    And
    Exl.EndVoting
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  7. #7
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    Here's a Proof of Concept PP

    Doesn't save anything and it's ugly

    It does allow a user to pick candidates for 3 offices, and right now it just displays the choices at the end.

    It just uses just basic PP actions to take action on a clicked picture, no class modules, etc.

    Slide 1 - Click "Ready" and go to next (Ready needs to initialize things)

    Slides 2, 3, and 4 - click pictures (change which one is clicked works)

    Slide 5 - Click "Done" (where the saving would be done) and exit or click "Home" to restart
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,711
    Location
    This is a slightly more polished (less crude) version that uses the Office in the slide title placeholder instead of the .SlideIndex

    SlideIndexes can change, so I don't like to rely on them
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •