Results 1 to 20 of 24

Thread: Solved: Excel Crashing Problems HELP

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Regular
    Joined
    Jul 2011
    Posts
    17
    Location

    Exclamation Solved: Excel Crashing Problems HELP

    <--- thats me, right now

    Okay here is the problem

    I ahve a userform with a multipage control and a command button

    frmSchedule and multipage1 and cmd_Add

    I CANNOT add a page the multipage control WITHOUT excel crashing. Error handling does NOTHING. i can report the error but not stop excel from crashing.

    My code is simple:

    [vba]
    Option Explicit 'Always have it

    Sub cmd_Add_Click()
    Dim newPage as Page
    Set newPage = Me.MultiPage1.Pages.Add
    End Sub
    [/vba]
    That should add a blank page. I cant even get it to do that. It won't.

    I have tried declaring newPage the following ways:
    [vba]
    Dim newPage
    Dim newPage as Page
    Dim newPage as object
    [/vba]
    I Tried to invoke the function in the following ways:
    [vba]
    Set newPage = frmSchedule.MultiPage1.Pages.Add
    Set newPage = Me.MultiPage1.Pages.Add
    Set newPage = MultiPage1.Pages.Add
    [/vba]
    I have tried all combinations of all three and every time i get the same damn error:

    Automation Error.

    Object invoked in disconnected from its client.

    Then excel crashes NO MATTER what i do..

    The other week, the code worked fine. not a problem, must have added and delete several thousand pages during testing. Now... NOTHING.


    Please help.. what is it doing..
    Last edited by BigJC; 09-26-2011 at 04:03 AM.

Posting Permissions

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