Save Each Sheet As PDF - Help

I am attempting to divide out a drawing file into multiple PDFs based on the sheet names. I found the attached is code and downloaded from 3D content central. I haven't recieved a response yet from the creator so I'm bringing it up to you all. I can't use this code though multiple people on 3D Content Central have used it successfully. When I run it, SW tells me there is an error @ ...

'declare and set modelDoc object

    Dim swDoc As ModelDoc2

    Set swDoc = swApp.ActiveDoc

While I am terrible with VBA as of yet I do understand that this code may need some revising for my specific files/filepaths. I am desperately looking for help here. This task will take a great deal of time if I have to do manually so please help ...

Message was edited by: Tyler Banschbach

SolidworksApi macros