print as PDF macro

Jul 26, 2007 8 Replies

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



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

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.

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

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.

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

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

at:

formatting link

Matt,

I would appreciate if you could.

Thanks, Bill

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required