+ Reply to Thread
Results 1 to 6 of 6

Dim problem with MultiPage Userform

  1. #1
    Registered User
    Join Date
    08-31-2013
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    3

    Dim problem with MultiPage Userform

    Can anyone help? ...

    I have an application which displays different variants of a userform depending on the size of screen being used.

    There are 2 versions of each userform eg. Scr1366_Menu and Scr2560_Menu

    In order to simplify coding and maintenance, I've been using an object variable (set when the Workbook is opened) to determine which userforms are displayed.

    Please Login or Register  to view this content.
    .


    Subsequent code refers to ThisForm_QD thus removing the need for multiple versions of code.

    My problem ...

    The Dim statement works fine for regular userforms but crashes when the form referred has a multipage control. Runtime error "1004". Application-defined or Object-defined error.

    Any idea why this would be?

    Thanks
    Last edited by IvivaJCM; 10-14-2014 at 07:59 AM. Reason: [code] markers not shown. Oops!

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Dim problem with MultiPage Userform

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Dim problem with MultiPage Userform

    I don't see how a generic Dim statement can crash. Where exactly does the error occur?
    Remember what the dormouse said
    Feed your head

  4. #4
    Registered User
    Join Date
    08-31-2013
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Dim problem with MultiPage Userform

    Thanks Rory,

    The monitor size is 1366 & all statements up till

    Please Login or Register  to view this content.
    ... execute fine. I've checked that the name of the userform is correct & the only difference I can see is that this has multipage controls.

    It's driving me mad!

    Also ... I noticed that my original post contained a type"o". ThisForm_QD should have read FrmCDetail (I edited the post having omitted the code section first time round)

    Joanna

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Dim problem with MultiPage Userform

    Set your VBE options to Break in class module using Tools - Options - General tab (if you haven't already) and then step through the code again to find the real error line.

  6. #6
    Registered User
    Join Date
    08-31-2013
    Location
    Worcester
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Dim problem with MultiPage Userform

    Thank you Rory.

    Not sure what happened but the code now compiles fine ... I think it might have been a problem with loading a chart on another form.

    I now of course have another woe but I'll scratch my head for a bit before bothering the forum.

    Have a great afternoon.

    Joanna

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Userform Max Multipage
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2014, 05:12 AM
  2. Help Populating Textboxes in Userform, With Multipage Userform.
    By mdmorgan24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 05:29 PM
  3. Userform Multipage Help
    By redjay in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-25-2008, 04:41 AM
  4. Multipage on a userform
    By Macdave_19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-09-2007, 12:32 PM
  5. Userform - Multipage
    By marcospaterson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2007, 06:33 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1