print as PDF macro

Discussion in 'SolidWorks' started by Bill, Jul 26, 2007.

  1. Bill

    Bill Guest

    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, Jul 26, 2007
    #1
  2. Bill

    fcsuper Guest

    Bill,

    I have some general advice about macros at: http://sw.fcsuper.com/index.php?name=FAQ&id_cat=3#q9

    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
    http://sw.fcsuper.com
    Co-moderator of http://tech.groups.yahoo.com/group/solidworks/
     
    fcsuper, Jul 26, 2007
    #2
  3. Bill

    Bill Guest

    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.
     
    Bill, Jul 26, 2007
    #3
  4. Bill

    fcsuper Guest

    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
     
    fcsuper, Jul 26, 2007
    #4
  5. Bill

    Bill Guest

    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.
     
    Bill, Jul 26, 2007
    #5
  6. Bill

    Bill Briggs Guest

    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
     
    Bill Briggs, Jul 26, 2007
    #6
  7. Bill

    fcsuper Guest

    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
     
    fcsuper, Jul 26, 2007
    #7
  8. Bill

    Bill Guest

    Matt,

    I would appreciate if you could.

    Thanks,
    Bill
     
    Bill, Jul 27, 2007
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.