+ Reply to Thread
Results 1 to 3 of 3

vba code, command bar, command bar button, one button works but not two

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    Waterloo, iA
    MS-Off Ver
    Excel 2007
    Posts
    14

    Question vba code, command bar, command bar button, one button works but not two

    Hi,

    I have code that I've copy+pasted from another functioning workbook with new toolbar names, button names, etc. The problem is that one of the buttons (the second one) works fine, but the first one give me an error that says "Cannot run the macro "Document.xls'!GetWeeklyData'. The macro may not be available in this workbook or all macros may be disabled." Here's my code:
    Please Login or Register  to view this content.
    Both Subs are in the same document and all of the macros are enabled. The "SaveCopyAsCSV" Sub is in its own module as is the "GetWeeklyData" Sub. I can go into the sub and step through the "GetWeeklyData" Sub just fine and it runs, but when attached to the button, it doesn't. I don't understand why it wouldn't work just like the other one, so any help is greatly appreciated. Thanks!

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

    Re: vba code, command bar, command bar button, one button works but not two

    Is the GetWeeklyData sub in a module called GetWeeklyData by any chance? Or have you perhaps misspelled the name?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    06-04-2012
    Location
    Waterloo, iA
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: vba code, command bar, command bar button, one button works but not two

    Yes it is... Now that I renamed the sub to just GetData, it works just fine!

    Thank you for catching that. Guess I need to get more creative with my naming.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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