Consulting

Results 1 to 10 of 10

Thread: Solved: Error with Loading Userform.Show

  1. #1
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location

    Solved: Error with Loading Userform.Show

    Hey guys,

    This is something I'm really not sure why is happening. I keep getting an "Object variable or With Block variable not set" error with the following code highlighted when I debug:

    [vba]pdfForm.Show[/vba]
    This only happens when I bring something from work (Excel 2000) home (Excel 2003) and work on my excel file.

    I don't know where to start looking, any ideas?

    TIA




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  2. #2
    VBAX Contributor Ivan F Moala's Avatar
    Joined
    May 2004
    Location
    Auckland New Zealand
    Posts
    185
    Location
    Step through your Userform code or put Break points in to see where the code bugs out.
    Kind Regards,
    Ivan F Moala From the City of Sails

  3. #3
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Thanks Ivan, I'll give it a whirl.




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  4. #4
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    Most likely in Userform_Initialize(). These can be a pain in the ass to find. Strange that it would work on 2000, but not 2003.

  5. #5
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Quote Originally Posted by BlueCactus
    Most likely in Userform_Initialize(). These can be a pain in the ass to find. Strange that it would work on 2000, but not 2003.
    You said it. Pain in the ass. Especially cause VBA just highlights the Userform.Show line when you open the form by another module (instead of just testing it from the VBE)....sigh.

    And yes you're right...it was in _Initialize()

    It ended up being 2 things wrong. First part was when I edited it and forgot a End With statement (i.e. the first error). The second I don't remember entirely what it was...I think it was something like a line of code that you couldn't use in 2000...or SOMETHING like that...Don't know why I'm drawing a blank.

    Anyway, it's fixed for now. Thanks for the suggestions guys




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by malik641
    You said it. Pain in the ass. Especially cause VBA just highlights the Userform.Show line when you open the form by another module (instead of just testing it from the VBE)....sigh.
    Do you have your VBIDE options set to 'Break in Class Module'

  7. #7
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Quote Originally Posted by xld
    Do you have your VBIDE options set to 'Break in Class Module'
    Or Break on All Errors.

    Or you can hit F8 when the Show is highlighted to step through the Initialize code.

  8. #8
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Bob and Norie, thank you both

    That will surely save me time now




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  9. #9
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    ...and don't forget Compile VBAProject.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  10. #10
    Administrator
    2nd VP-Knowledge Base VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    Quote Originally Posted by mdmackillop
    ...and don't forget Compile VBAProject.
    Will do thanks MD




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •