+ Reply to Thread
Results 1 to 2 of 2

Name of workbook corrupts macros

  1. #1
    Registered User
    Join Date
    04-17-2020
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    6

    Name of workbook corrupts macros

    So I have the attached workbook which is an example of a sheet I'm using to capture data and save in registered locations on a local network. All this information is in the VBA code. When I save the file using the command buttons at the bottom, it saves with a certain name in a specified location based on information within the sheet, at which point someone else will open the workbook and continue working on it. The problem is, with the workbook saved as the attached file name, when they open the workbook, all the macros are corrupted and delete themselves. However, if I close it without saving after the macros have been corrupted and change the name of the workbook to delete the "ST" portion (so it now is named 1CS-176 0.236-0.315), ALL THE MACROS ARE NO LONGER CORRUPTED. They just come back and everything works again. I thought it was based entirely on how long you make the name of the file, seeing as if I change "ST" to be something longer like "12345", it's still corrupted (is that a thing, file names exceeding a character limit corrupt macros?), but if I copy the workbook to another location after opening with corrupted macros, again they're no longer corrupted. What the f*** is happening and why are the macros only corrupted in very specific instances???
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,902

    Re: Name of workbook corrupts macros

    Probably more to do with the folder/sub-folder structure and the length of the names of each level.

    I'd suggest trying saving the file at quite a high level, for example, in My Documents, or better still, a folder at the root level ... say, C:\Test
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Macro Corrupts Workbook
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2018, 11:59 AM
  2. [SOLVED] Backup Macro corrupts Workbook
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-11-2017, 10:56 AM
  3. Excel 2007 Corrupts Workbook
    By jo15765 in forum Excel General
    Replies: 4
    Last Post: 01-21-2015, 04:07 PM
  4. Replies: 1
    Last Post: 12-12-2014, 03:25 PM
  5. Can't access macros in personal.xlsb workbook from macros in a second workbook
    By JimFM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2013, 03:35 PM
  6. Excel corrupts files?
    By Random2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2010, 03:52 AM
  7. [SOLVED] Attaching to an email corrupts workbook
    By edger in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 06:40 PM

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