+ Reply to Thread
Results 1 to 17 of 17

Batch Print\Save PDF summary report for student assessment

  1. #1
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Batch Print\Save PDF summary report for student assessment

    Hi,
    I have been working in VBA to create a macro (button) to automatically print a summary page for each student in my class. I have copied a MS macro from a template but cannot modify to suit my needs.

    My workbook has multiple sheets - attendance, homework, assessment tasks etc. I have created a 'Print Summary' sheet and formatted ready to print/save to pdf and distribute. This 'Print Summary' sheet has a drop down list (of students) and automatically populates the sheet with data from the other relevant sheets when a specific student is selected.

    I would like to create a macro to automatically save 'Print Summary' page to .pdf of each student as a single file. Ideally, the macro would save the files as:
    SURNAME GIVEN NAME (cell C9 and E9)
    in a folder TOPIC (cell D11)

    eg E:\User\Folder\TOPIC\SURNAME GIVEN NAME.pdf

    Many thanks
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Welcome to the forum

    Cross-post;http://forum.chandoo.org/threads/pri...essment.22257/

    Please read forum rules:http://www.excelforum.com/forum-rule...rum-rules.html
    Read this;http://www.excelguru.ca/content.php?184
    Please click the * Add Reputation if this helps
    If solved remember to mark Thread as solved

    "I'm glad to help and this is not meant to sound smart, but either you have super-human vision to see all those controls cleared one by one with the code I posted, or your computer is really slow."

  3. #3
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Something like this, not tested.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Thanks for the reply Blokeman. Apologies to all for not Cross posting.

    I have copied the code into VBA and I am receiving a Run-time error '76' Path not found message. I have made several attempts to change the directory (to different drives) with no success.

    Any suggestions?

  5. #5
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Check the directory and change red text to your username;
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Thanks again but I am still having issues. (Run-time error 76)
    My knowledge is very limited and I am learning through experimenting.

    I will run through the steps I have taken:
    Open workbook (.xlsm macros enabled in settings)
    Alt +F11 to open VBA
    Insert Module
    Double click on Module1 and copy code provided with ChDir amendments. I have tried:
    ChDir "C:\Users\UserName\Folder\" & Range("D11") & "\Pdf" - C: drive is SSD/E: drive is storage. Folders were created and renamed
    ChDir "E:\TPC\Year 12\Yr 12 Reports\" & Range("D11") & "\Pdf" - copied address from window address bar
    ChDir "G:\Reports\" & Range("D11") & "\Pdf" - where G: drive is SD card
    Save and run

    Not sure what I am doing wrong.

  7. #7
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    What version of windows are you using?

  8. #8
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Windows 8.1
    Microsoft Office 2013

  9. #9
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Change the username to your windows username, if you don't know your username then run this;
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    I had input the correct username but still no luck.

    Just to clarify, my own workbook contains a modification of the freely available 'Gradebook with printable student progress report' template found within MS excel. This VBA macro to print all reports is what I am after but to save as pdf rather than print. to specific file)


    Option Explicit
    Private Sub PrintAllSummaries()
    On Error Resume Next
    Dim i As Long
    Dim sCount As String
    Dim vStudents As Variant

    vStudents = [StudentLookup]
    i = UBound(vStudents)

    If i > 1 Then
    sCount = i & " students "
    Else
    sCount = i & " student "
    End If

    If MsgBox("A progress report for " & sCount & "will be sent directly to the printer." _
    & vbCr & "Do you want to continue?", vbYesNo + vbDefaultButton2 + vbQuestion, _
    "Student Gradebook") = vbYes Then
    With Sheet2
    For i = 1 To i
    [StudentName] = vStudents(i, 1)
    DoEvents
    .PrintOut IgnorePrintAreas:=False
    Next
    End With
    End If

    End Sub

    Would it be easier to modify this code to suit?

  11. #11
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    The problem with the code is the file path (missing folder, wrong spelling, etc). This code will save in your desktop, tested.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Thanks Blokeman. Very much appreciated.

    One last question - is there a way the code can cycle through a class list of students (Data Validation dropdown List in cell E9) to save all student reports as individually named files rather than manually selecting each student and applying the code (Macro assigned to button).

  13. #13
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Try; untested
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Thanks. Tried the code provided and came back with a Compile Error - Variable not defined (highlighting sPath).

  15. #15
    Forum Contributor
    Join Date
    08-15-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    349

    Re: Batch Print\Save PDF summary report for student assessment

    Ooops, add this;

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Blokeman - You are a STAR!!!

    After a little bit of tinkering (naming cells in worksheets), I now have a fully functioning macro assigned to a button on my Print Summary worksheets.

    My sincere gratitude for your time and patience.

  17. #17
    Registered User
    Join Date
    04-16-2015
    Location
    Victoria, Australia
    MS-Off Ver
    2013
    Posts
    9

    Re: Batch Print\Save PDF summary report for student assessment

    Blokeman - You are a STAR!!!

    After a little bit of tinkering (naming cells in worksheets), I now have a fully functioning macro assigned to a button on my Print Summary worksheets.

    My sincere gratitude for your time and patience.
    Last edited by TPC; 04-26-2015 at 06:58 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert Detailed Time Attendance report from Biometrics to Summary Report
    By firescorpio in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2013, 02:48 AM
  2. [SOLVED] Creating an Automatic Student's Report
    By alyaahmed in forum Excel General
    Replies: 2
    Last Post: 03-25-2013, 10:48 AM
  3. Form Email from Report, Only if Report summary sheet lists Acct for that Sales Rep
    By lukep10 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-28-2008, 01:38 PM
  4. Creating a Summary Table of a Student Questionnaire
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-28-2005, 10:39 AM
  5. Replies: 1
    Last Post: 04-29-2005, 10:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1