Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Running a template when loading Excel (Excel 2003)

    Can anyone help?

    I have an Add-In in Excel that creates a toolbar, the toolbar is called via Auto_Open, with the Add-In stored in XLStart. When opening the application the Auto_Open function will not run eventhough the Add-In is selected. I'm sure it is such a silly fix but for the life of me I just can't see what I have done wrong.

    Any help greatly appreciated.

    Cheers
    Jack

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Running a template when loading Excel (Excel 2003)

    Is macro security set to High?

    What do you mean by "the add-in is selected"? If it is stored in XLStart, you don't need to install it in Tools | Add-Ins...

  3. #3
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running a template when loading Excel (Excel 2003)

    Hi Hans

    Security is set at Low and I have deselected the Add-In option, and have the Add-In stored in XLStart - still no joy.

    Regards
    Jack

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Running a template when loading Excel (Excel 2003)

    Try putting a line

    MsgBox "Auto_Open is running"

    at the beginning of the Auto_Open macro. You can also create a Workbook_Open event procedure in the ThisWorkbook module:

    Private Sub Workbook_Open()
    MsgBox "Workbook_Open is running"
    End Sub

    Both message boxes pop up when I store an add-in in the XLStart folder.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running a template when loading Excel (Excel 2003)

    No joy !!

    Within the xlt file, I placed a message box in Auto_Open and Workbook_Open, saved the template. I then Saved As an xla and placed the xla in XLStart. Closed Excel then opened the application, no message box appeared. One thing I am aware of is that we have a personalised Book.xls that is also stored in XLStart, no code resides in this file - not sure whether this could potentially be impacting the add-in.

    Regards
    Jack

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Running a template when loading Excel (Excel 2003)

    The default workbook template should be Book.xlt, not Book.xls, but that shouldn't make any difference.

    What happens if you place the .xla file from the attached zip file in your XLStart folder?

  7. #7
    2 Star Lounger
    Join Date
    Mar 2005
    Location
    Kent, England
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running a template when loading Excel (Excel 2003)

    The xla you sent works as expected. I have placed the toolbar code within the template and it appears to be working fine now. Have no idea what I must have done to cause the Auto_Open function not to run.

    Many thanks for your help Hans.
    Jack

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Running a template when loading Excel (Excel 2003)

    Perhaps Auto_Open was in the wrong module? It should go in a "normal" module, NOT the thisworkbook module.

    I'd advise against putting an addin in XLSTART, instead, put it in the library folder or the addins folder and install the addin through tools, addins.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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