+ Reply to Thread
Results 1 to 8 of 8

Do files with Macros have to keep the same filename?

  1. #1
    Forum Contributor
    Join Date
    12-11-2013
    Location
    St Moritz, GR, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    187

    Do files with Macros have to keep the same filename?

    Do files with Macros have to keep the same filename?

    If they do, that makes sense. I've seen myself get confuzzled when if I Save As>different name.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Do files with Macros have to keep the same filename?

    If the macros are held in the workbook in question, (as opposed to being held in the separate and often hidden Personal.xlsm) workbook, then the file can be saved and renamed however you want. It will still retain the macros.

    Not sure why you should encounter any problems when saving as a different name. You do need to save the workbook as a .xlsm file. Maybe that's the problem and that you have been saving as just a .xlsx workbook.

    If not can you give a bit more clarification? i.e. exactly what are you doing and what are you calling the files.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    12-11-2013
    Location
    St Moritz, GR, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Do files with Macros have to keep the same filename?

    I'll try. When I try and open a file, I get this, click "Update", then untitled2. THe file opens and when I try and use a Macro I "wrote" earlier (does not claim to speak VB natively), I get untitled 3.

    File itself is uploaded for convenience. I'm lost :-(
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Do files with Macros have to keep the same filename?

    Please explain what you are trying to do with your workbook.

    It contains one 'FillName macro of any note and it's not clear at all what this is attempting to do.

    The Search button on sheet1 is also attached to a macro in another named workbook which may be the source of your problems, particularly if it refers to a file name that you have subsequently renamed or moved elsewhere.

  5. #5
    Forum Contributor
    Join Date
    12-11-2013
    Location
    St Moritz, GR, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Do files with Macros have to keep the same filename?

    I'm attempting to make a search box where you type your name into the box; and hit the button on the right to search. Names are listed in column A.

    Would it be easier if I just root out the button and put in a new one? Or I can reassign the Macro by Right click, Link to a Macro?

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Do files with Macros have to keep the same filename?

    Hi,

    Just reassign the macro to which the button is directed to a macro in the current workbook.

    I'm not entirely sure why you need a text box. Why not just enter a name in a cell. If you want to select a name from a drop down use data validation with a named list.

    What is supposed to happen when you click the button?

  7. #7
    Forum Contributor
    Join Date
    12-11-2013
    Location
    St Moritz, GR, Switzerland
    MS-Off Ver
    Excel 2010
    Posts
    187

    Re: Do files with Macros have to keep the same filename?

    It's supposed to search for the name you've entered. I'll mark solved meanwhile.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Do files with Macros have to keep the same filename?

    Do you mean that the file is supposed to be automatically saved with the name shown by the character string that appears in the box/cell?

+ 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. [SOLVED] Copying files based on filename
    By audioboxer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2012, 01:27 PM
  2. Run Macro on multiple files and save filename
    By anrivel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-28-2011, 03:03 PM
  3. Replies: 5
    Last Post: 02-17-2010, 02:02 PM
  4. Files won't open when dbl click on filename
    By Global MHP in forum Excel General
    Replies: 3
    Last Post: 11-25-2005, 01:30 PM
  5. Replies: 1
    Last Post: 01-10-2005, 04:06 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