print as PDF macro

I am having trouble getting the SaveDwgAsPDF1.22 macro to work that I downloaded from Lorono's Solidworks Resources

When I run the macro with the a drawing open I get the following error:

Run-time error '91': Object variable or With block variable not set

When I hit debug option VB opens and highlights the line swFrame.SetStatusBarText "Done"

What am I doing wrong?

I'm running SW2007 SP4

Thanks, Bill

Reply to
Bill
Loading thread data ...

Bill,

I have some general advice about macros at:

formatting link
Since this is a status bar issue, I'm guessing it has something to do with the reference libraries. However, this error shouldn't come up before the macro does the important part of its function (creating the PDF file), so this makes me wonder just how you are running the macro. Can you describe how you are running this macro?

Matt Lorono

formatting link
of
formatting link

Reply to
fcsuper

Reply to
Brian Putnam

at:

formatting link

I have tried running from macro button added to the tool bar and from tool\macro\run

I enter a valid path I get the same error only this time debug goes to this line: swFrame.SetStatusBarText "Saving PDF file"

Thanks for your help.

Reply to
Bill

at:

formatting link

Just edit the macro to remove the two swFrame.SetStatusBarText lines if nothing else works. These are only notifications anyway. But I am concerned you are having an issue with this. Have opened this macro yet and looked into they reference libraries to see if any of the the word [MISSING] in front of them?

Matt

Reply to
fcsuper

at:

formatting link

Yes, I checked the reference libraries and found nothing with [MISSING]. I also added "SolidWorks 2007 Commands type library" as suggested with no luck. I going to try it on another machine to see if it works.

Thanks again.

Reply to
Bill

I have not seen the macro but is there a line somewhere that starts with the following...

Set swFrame =

if not, that is a problem

Reply to
Bill Briggs

at:

formatting link

Just edit the macro to remove the two swFrame.SetStatusBarText lines then. Might be a bug with SP4. :( It's working here on 2005 SP5 and

2007 SP3.1. If you like, I can upload the older version of this macro without hte setstatusbartext lines.

Matt

Reply to
fcsuper

at:

formatting link

Matt,

I would appreciate if you could.

Thanks, Bill

Reply to
Bill

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.