API - Why is macro playing "through" a displayed form?

Discussion in 'SolidWorks' started by Fye, Mar 13, 2006.

  1. Fye

    Fye Guest

    This one is bugging the crap out of me.

    I have a macro that opens several SolidWorks drawings in succession.
    After one is opened, a new userform is displayed, awaiting input.

    Now, for some reason, whenever I play the macro, SW does not display it
    and just keeps continuing through until it crashes (unsure about that
    reason too).

    However, if I run the macro through the VB editor (step by step), it
    plays fine, displaying the form and awaiting input.

    Any ideas?
     
    Fye, Mar 13, 2006
    #1
  2. Fye

    That70sTick Guest

    Is the form modal? A modal form stops the routine that calls it until
    the form is closed.
     
    That70sTick, Mar 13, 2006
    #2
  3. Fye

    Fye Guest

    Tried both ways... same result either way.

    Funny part is that it used to work fine before I made some revisions...
    obviously, I'm trying to figure out what I may have changed since the
    revision, but I honestly can't figure out what could possibly cause
    this - especially considering that if I run it manually (step by step)
    it works fine.
     
    Fye, Mar 13, 2006
    #3
  4. Fye

    Jeff Guest

    One thing to look for here, is a call or redirect that is a runtime
    issue.

    Are you willing to post or send the code?

    Jeff
     
    Jeff, Mar 15, 2006
    #4
  5. Fye

    Fye Guest

    Ok, just found out what the problem was, and it did turn out to be a
    modal/non-modal form problem.

    It had to do with displaying the main form in modal. What was really
    odd is that it worked fine on other computers, but not the one that i
    was using to develop the macro. What's even more odd is that it just
    started to "not work" for no apparent reason.

    Oh well, at least it's working now. Took a full day of research and
    trial and error to find out that it was just one CHARACTER from being
    correct.

    frmMainForm.Show 1
    instead of
    frmMainForm.Show

    go figure.
     
    Fye, Mar 15, 2006
    #5
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.