+ Reply to Thread
Results 1 to 3 of 3

A macro name has suddenly add on the name of the workbook. Is this a potential problem?

  1. #1
    Forum Contributor
    Join Date
    07-02-2012
    Location
    Florida
    MS-Off Ver
    Home -Excel 2007, Work 2016
    Posts
    254

    A macro name has suddenly add on the name of the workbook. Is this a potential problem?

    I do not have enough experience with macros to know if this is a potential problem or not.
    Picture 1 - The file name in View Macros was not attached until I renamed the module it is in.
    Note - I had already renamed 3 others and they did not change.
    Problem or Potential Problem??
    Thanks!!

    Picture 2 Left here - went back to workbook. Saved it, closed and open. Now several with the file name attached -

    And now getting "Can not run"

    Hoping there is a wise and kind person out there with ability to help.

    Note - I have copies of all macros so I could start over
    Attached Images Attached Images
    Last edited by ILoveStMartin; 12-19-2019 at 03:30 AM. Reason: Make it readable

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: A macro name has suddenly add on the name of the workbook. Is this a potential problem

    Hi,

    I cannot duplicate your problem in Excel from Office 365, but it may be a problem in older versions of Excel.

    There are several unwritten rules that I follow to avoid collisions like you are experiencing for two reasons:
    a. There may be a collision problem which will probably be difficult to find.
    b. To avoid confusion.

    My personal rules include:
    a. I always start Code Module Names with 'Mod' e.g. 'ModPrintSheet1'.
    b. I never start routing names with the letters 'Mod'.
    c. I never declare variable names with the same names as the routine (e.g. 'Sub PrintX()' will never have a variable named 'PrintX'.

    Above all be consistent in your personal naming conventions.

    NOTE: You probably have duplicate routine names if you ever see all items in the the Macro List of the form:
    File Name!abc (All routines in the active file should not have the file name prepended)

    I hope this helps.

    Lewis

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: A macro name has suddenly add on the name of the workbook. Is this a potential problem

    .
    I wonder .. did you have more than one workbook open when performing those actions ?
    Do both workbooks have macros named the same or similar ?

    If so, you may have only been seeing the macros from both workbooks, renamed the wrong one and now since only the single workbook is open Excel can't locate the macro.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Method or data member not found: new problem suddenly appearing
    By jeffcp66 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2019, 05:41 PM
  2. Macro to login to website provide objective error - potential parameter problem
    By Armored Wing in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2018, 12:38 AM
  3. Replies: 1
    Last Post: 02-01-2018, 10:11 AM
  4. Discussion of dynamic potential of 'data validation by row' macro
    By zextrot in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2017, 04:19 PM
  5. Replies: 2
    Last Post: 05-22-2015, 01:03 PM
  6. Replies: 3
    Last Post: 01-07-2015, 12:19 PM
  7. VBA to Unprotect Workbook suddenly not working
    By reba0729 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 01:45 PM

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