Results 1 to 6 of 6
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Auto_Open Macro failing (XL 95)

    Arrgh - more problems with the same durn file! (Isn't that always the way) Now the Auto_Open macro is failing to run. The job of this macro is to build a toolbar.

    Sub Auto_Open()
    Application.MoveAfterReturnDirection = xlToRight

    Set myNewToolbar = Toolbars.Add(Name:="DataTransfer")
    myNewToolbar.ToolbarButtons.Add Button:=211, Before:=1
    myNewToolbar.ToolbarButtons.Add Button:=229, Before:=2


    With Toolbars("DataTransfer")
    .Visible = True
    .Left = 700
    .Top = 250
    .Width = 69
    .ToolbarButtons(1).OnAction = "DataEntry"
    .ToolbarButtons(1).Name = "Format Data"
    .ToolbarButtons(2).OnAction = "DataTransfer"
    .ToolbarButtons(2).Name = "Hand to Resource Allocation File"
    End With

    End Sub

    Does this mean that the file is corrupted?

    I have several versions now - seems to be happening in all of them.

    Cheers
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Auto_Open Macro failing (XL 95)

    Catherine,

    I cannot really remember too much about xl95 VBA, but wonder have you a reference set up to the Office object library, as that may be needed for manipulating toolbars. Perhaps your reference got broken.

    Andrew C

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Auto_Open Macro failing (XL 95)

    I copied the code into a new file - it works now. So the problem is solved. It just leaves me <img src=/S/headthrob.gif border=0 alt=headthrob width=15 height=15>
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Auto_Open Macro failing (XL 95)

    Catherine

    <<< more problems with the same durn file! (Isn't that always the way) >>>

    I guess it is time to UPGRADE !!!

    In the versions of Excel prior to 97, its best to have the Auto_Open and Auto_Close as short as possible

    I suggest that you do something like this:

    Sub Auto_Open()
    Call Thisworkbook.Name & "!ContinueAfterOpen"
    End Sub

    Sub ContinueAfterOpen()
    '/Your Code goes here.
    End Sub

    I don't know why this is necessary, but its documented in MSKB.

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  5. #5
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Auto_Open Macro failing (XL 95)

    Yes I'm hoping my client will "see" the light and upgrade. Hopefully not to QuattroPro...
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Houston, Texas, USA
    Posts
    432
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Auto_Open Macro failing (XL 95)

    I'm not sure what u mean by CALL THISWORKBOOK.NAME & "!CONTINUEAFTEROPEN"

    In THISWORKBOOK.NAME I tried using sheet1.Name, MasterTest.Name and they didn't work. What am I supposed to use?

Posting Permissions

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