Results 1 to 10 of 10
  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
    I'm troubleshooting an Addin that I'm bringing forward from 2003 to 2007

    The addin copies a worksheet into the file.
    The worksheet has buttons which run routines from the addin.

    On some machines - it works fine
    On others not - because the button prepends the name of the file to the routine name (and since the routine is not in the file - but rather in the addin - the whole thing fails).

    I can't figure out why this is happening.
    Any suggestions?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    Update: It appears to be caused by Service Pack 2

    Further this hotfix is supposed to repair the problem - I haven't completed testing myself

    Further update - the hotfix won't run on our troublesome machines (possibly because they are 64 bit?)


    I think its' time to go home now...
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Hi Catharine,
    I would suggest using code to change the OnAction property of the buttons after the copy to specify the add-in name rather than the workbook name.
    Also, that hotfix appears to relate to buttons on the QAT, not in workbooks?
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    [quote name='rory' post='788947' date='14-Aug-2009 05:19']Hi Catharine,
    I would suggest using code to change the OnAction property of the buttons after the copy to specify the add-in name rather than the workbook name.
    Also, that hotfix appears to relate to buttons on the QAT, not in workbooks?[/quote]
    Hi Rory
    These buttons are just buttons I've added to a worksheet - not a VBA form, so there is no OnAction property (pity).
    I think building a form is the way I'll have to go now.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts
    Catharine,
    If they are buttons from the Forms toolbar, they do have an OnAction property!
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    [quote name='rory' post='788990' date='14-Aug-2009 08:37']Catharine,
    If they are buttons from the Forms toolbar, they do have an OnAction property! [/quote]
    This forms toolbar - this dialog?
    I'm missing something here.
    Attached Images Attached Images
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    The OnAction property can be set in Visual Basic:

    ActiveSheet.Shapes("Button 1").OnAction = "My Macro"

  8. #8
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    [quote name='HansV' post='789031' date='14-Aug-2009 11:30']The OnAction property can be set in Visual Basic:

    ActiveSheet.Shapes("Button 1").OnAction = "My Macro"[/quote]
    Thanks
    I thought I could only control VBA forms through VBA. My learning for today!
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  9. #9
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    [quote name='HansV' post='789031' date='14-Aug-2009 11:30']The OnAction property can be set in Visual Basic:

    ActiveSheet.Shapes("Button 1").OnAction = "My Macro"[/quote]
    Do you tuck it inside a sub? The Worksheet_Activate event?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  10. #10
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    [quote name='WebGenii' post='789777' date='19-Aug-2009 10:34']Do you tuck it inside a sub? The Worksheet_Activate event?[/quote]
    For anyone who is following this
    I placed inside the code that launches the process (tying it to the worksheet_activate event wasn't necessary.
    Oh and the biggest (and most obvious thing) put quotes around the macro, just like the example.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

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