Personal Macro Workbook has gone missing (AGAIN)! - excel

I don´t understand why, but it´s the second or third time I've lost my Personal Workbook with all my macro copies. The only different thing that I've done was editing a macro but, when excel was closing, I haven't saved the changes. Next time I've opened excel, surprise, surprise, no Personal Workbook! Has anyone had the same problem? Does anyone know why it happens? I have already searched in (I believe so) all possible folders where It could be stored.
Thanks!

the file can be found for 2007/2010 users in :
C:\Users\User ID\AppData\Roaming\Microsoft\Excel\XLSTART
or somewhere similar for others.
Hope this helps

The folder where the personal macros are saved can be found by using the command:
?Application.StartupPath (without "" sign) in VBA.
Open VBA (ALT+F11) and enter the command in the field on the bottom.
Hope this helped

Using Microsoft office 365. Lost Excel and Word Macros during last update. Had an Excel File that I had copied to my laptop (Windows 10) which had not been updated. Brought it up on my desktop. Was able to see modules but no content. Was unable to remove modules. Uninstalled Office 365. After reinstall, was able to see and use macros from that file. Word macro not retrieved. Hope it helps someone.

Mine went missing completely and was not in the xlstart folder. I finally discovered it was because I'm on a work server, files are all network storage based, and I had just changed my network password. I think the mis-match caused my links to personal files to be temporarily broken. I logged out completely, and back in, and everything was back where it should be.
In short: I tried turning it off and turning it back on again.

For those using MacOS / OSX (El Capitan) with Excel 2016 I located my copy of Personal Macro Workbook.xlsb, which I had previously unhidden in Excel, then closed, in the following location:
~/Library/Containers/com.microsoft.Excel/Data/Application Support/User/Personal Macro Workbook.xlsb
Please note that I used multiple search functions within OSX which did not return this file in the search results for some reason.

Related

Corrupt VBA Project Module Not Found Error

I have a workbook that was saved yesterday afternoon, and was working perfectly. I have opened it this morning, and none of the modules in the VBE are 'found'. Visually I can see them all sitting there.
When trying to open any of these modules to edit the code, the windows are greyed out, as below.
When I try exporting the code modules, I get the 'Module Not Found' errror.
Does anyone know a) why this has happened, and b) how can I fix this?
I thought initially it was the instance of my Excel, so have restarted the PC.
Any help is appreciated!
I managed to find a workaround to this problem, so sharing the solution in the event that someone else comes across a similar problem.
It seems that the VBA Project got corrupt somehow. Below, find some suggestions and workarounds in trying to solve something similar in the future.
This is what worked for me. Convert the .xlsm file to a .xls file. You can do this by changing the file extension when renaming the file.
You can also try to convert to .zip file type, and then convert back to .xlsm. Note: convert COPIES of your original, just in case.
Other suggestions (as Chris Nelisen suggested) are:
Export your VBA modules regularly
Save different versions as you are building
My workaround, works perfectly:
Open Excel in safe mode (pressing and holding Ctrl while you start
the program, or by using the /safe switch (excel.exe /safe) when you
start the program from the command line)
Open corrupted workbook (from safe mode, File->Open-> navigate)
Do not enable macro if asked
Make sure macro is present (Alt+F11) - not necessary
Save as new workbook
Close safe mode excel
Open saved workbook as usual
This is a well-described issue, and it exactly matches what I have just experienced (even including the fact that I haven't been versioning recently).
My file has an xlsb suffix. Resaving with a different suffix did not work for me on the same PC, but I emailed the file to another PC, opened it, saved as xlsm, sent it back to the original machine and it now works fine again. I can even re-save with my preferred xlsb suffix and it still works.
I've also run this script to make a backup of my modules:
Sub ExportVbaModules()
'Acknowledgements to Andy Pope [ozgrid thread 60787]
Dim objMyProj As VBProject 'if error, go to VBA editor - tools - References - Microsoft Visual Basic-Extensibility5.3
Dim objVBComp As VBComponent
Set objMyProj = Application.ActiveWorkbook.VBProject
For Each objVBComp In objMyProj.VBComponents
If objVBComp.Type = vbext_ct_StdModule And objVBComp.Name <> "" Then
objVBComp.Export "C:\Users\MyName\VbaBackups\" & objVBComp.Name & ".txt"
End If
Next
End Sub
The And objVBComp.Name <> "" stops it from erroring when it encounters a corrupted module but turned out not to be necessary as the 'fixed' file contained no corrupted modules.
Since that export routine is so fast (40 modules / 100kb saved in <1s) I will be assigning it to a button on the ribbon with a better naming convention for the files it creates.
I copied my .xslm file from my PC to my OneDrive account.
I open the file on my iPad OneDrive account and then export to Excel for iOS. The file opens and says links and macros are disabled. I then save a copy of the file back to the OneDrive account. I go back to my PC and open the file from OneDrive. I re-establish the links.
The macros are from a backup. This is an issue if you aren't backing up your macros.
Do you have this file on OneDrive?
If yes, I was facing that issue, and resolved restoring the last save. If you open OneDrive site (onedrive.live.com), find the file, and select Version History. Download the penultimate.
When this happens on 64 bit Excel, I simply open the exact same file in 32 bit Excel and the macros re-appear.
When this happens on 32 bit Excel, I simply open the exact file in 64 bit Excel and the macros re-appear.
Try to open the excel file in repair mode and save as the file one more time.
Open and Repair
I tried everything suggested and nothing worked. I could only see the module when I opened my VB editor. It was not available through the view macros ribbon shortcut. I was unable to export the module or copy it to a new workbook.
What finally worked for me was emailing it to myself, downloading it through my 365 outlook account via a web browser, and then the code was there.

Get "Microsoft Excel has stopped working" message

I'm running MS Office 2010 on Windows 7 Professional.
I’ve been experiencing this problem periodically for the last month or so, not all the time, but probably once or twice a week.
I’m working on the VBA portion of a fairly complex workbook. I start the day by making a copy of the previous day’s workbook, and make any subsequent code changes on the copy. When I’m finished I’ll run VBA Code Cleaner, do a Debug, Save then exit Excel. I also save a backup copy. I’ll then reopen & close both of these workbooks a number of times just to satisfy myself that everything is still working.
The next day I’ll wake the computer and try to open these files, and as soon as the VBA code starts to run I’ll get the “Microsoft Excel has stopped working” message. This can happen to either the main file or the backup file, and sometimes both.
If I open the bad file with the shift key down, I can get into the VBE area OK, but when I do a Debug or try to run VBA Code Cleaner I get the same message.
The only way I’ve found to recover from this is to:
Manually export the code
Save the file as an xlsx file, thus expunging all the code.
Save the xlsx file as a new xlsm/xlsb file, and then import the exported code.
I just today found another way to recover is to save the file as “xls”, then re-save as xlsb/xlsm, that somehow seems to “clean” something.
After the recovery everything is fine again, at least for a few days.
What I’ve tried so far:
Searched the internet, including StackOverflow, for possible solution.
Run various virus checkers (MS Essentials, Malwarebytes, SuperAntiSpyware)
Repaired MS Office 2010.
Uninstalled and re-installed MS Office 2010
Removed all add-ins
Uninstalled Dropbox
Started using a new user profile.
I came across several articles that suggested xlsb files were prone to corruption, so I started saving as xlsm files. Everything went well for about a week, and I thought I’d resolved the problem. However, it’s now started happening with the xlsm files too, so I’m back to square one.
I’m running out of ideas - the next thing I might try would be re-installing Windows 7, but I really hope to avoid doing that! I would really appreciate any suggestions. Thanks.
Well, I believe I may have found my problem. I noticed that one of my class objects wasn't always terminating correctly, due to it being referenced in a different class. I fixed that, and now it's been 11 days without any problem (touch wood). So I'm reasonably confident that this was the root cause. But I must admit I'm still not quite sure why this occasionally corrupted the workbook.

PERSONAL.XLAM is being opened as read-only

I've been using a PERSONAL.XLAM file for years in Excel 2013(?) with no issue. I am now using Excel for Office 365 and am having a problem using the same file.
I used to be able to open a workbook, PERSONAL.XLAM would open along with it, and I could go into Developer > Visual Basic, and change VBA code and save. Perfect.
Now, with Office 365, I get an error saying I can't save because PERSONAL.XLAM is read-only. I checked the Windows file attributes, and the Read-only checkbox is not checked, so I'm not sure why it would be opening as read-only.
In addition to now using Office 365, I'm also on an entirely new PC, so there might be something I'm missing, but I don't know what to do.
Edit: I think I found a new wrinkle. I moved the Personal file from my XLSTART folder to my desktop. If I open the Personal file directly from there, I get an error that says, "Sorry, Excel can't open two workbooks with the same name at the same time." Does that mean it is open somewhere else already?
I figured it out. I actually had code in Workbook_Open that looked at the Application.UserName. If it wasn't a match for what it checked against, it made the Personal file read-only. And as I mentioned before, I got a new computer and my name was set to something different. After I changed my username back to what I used to use, everything is back to the way it was.
If it wasn't for that "security check," I wouldn't have had any issues. In other words, you can have the XLAM file in the XLSTART folder and make changes to it while you have it open, which is what I wanted.
This is obviously a self-imposed, yet accidental, issue. I'll mark it as answered, but if it would be better to close it, that's fine too.

Opening Excel file from Sharepoint as Read-Write

I automatically open, edit, save and close several Excel workbooks from a Sharepoint location. The following code opens the workbooks (path loops through a list to hit each workbook name):
Workbooks.Open Filename:=path, ReadOnly:=False, Editable:=True
The files open in Read-Only mode, and the yellow dialogue option to Enable Editing does not appear.
I edit these workbooks manually and through a macro, but I am unable to save the files back onto the Sharepoint afterwards without saving as a new file.
I am using Excel 2013. This was working as intended about a year ago, but I believe there may have been updates to Office 365. I checked all of the Excel workbook security options, and nothing is set to open by default as Read-Only.
Is there any way to open the file in an editable mode through the macro, or at the very least allow the Enable Editing option to appear for each workbook?
I have been trying to fix the same problem for my files, and eventually did! So I felt that I could maybe let others know. And this old-ish thread came up near the top of my google search.
What fixed it for me was to edit the link.
from:
https://Company.sharepoint.com/:x:/r/teams/TeamNo/Shared%20Documents/Example/CoolFolder/TheBestExcelFile.xlsm
To:
https://Company.sharepoint.com/teams/TeamNo/Shared%20Documents/Example/CoolFolder/TheBestExcelFile.xlsm
Note that I only used replace to get rid of :x:/r/. I feel like I should have noticed this before but I didn't and no amount of meddling with the Workbook.Open parameters got me anywhere. It just seems odd that the default link copy thing gives you one with special commands in it. For our company most folders have spaces so the link has tons of "%20" in there so I simply read over the ":x:/r/".
Hope it helps someone.
Just for clarity, try this:
Sub Example()
'1.) Get filepath from somewhere
FilePath = Replace("https://Company.sharepoint.com/:x:/r/teams/TeamNo/Shared%20Documents/Example/CoolFolder/TheBestExcelFile.xlsm", ":x:/r/", "")
'2.) Open the file
Set StatisticsFile = Workbooks.Open(FileName:=FilePath, Password:="123")
'3.) Do things
'4.) Close the Sheet, save the changes. I simply like it this way, could be done in a single line.
StatisticsFile.Save
StatisticsFile.Close savechanges:=False
End Sub
I noticed this solution because I could still save the .xlsx file manually with the same name if I navigated to SaveAs. So if you guys can still do that after opening the file via macro, try a similar solution.
The interaction designed for Excel-OneDrive-SharePoint is new in 2016 apps and that version is a requisite to properly work.
The version 2013 may work by tweaking the OnDrive “Account” settings regarding Office co-authoring configuration which is specifically applied to Excel and Word
Right click the OneDrive icon in the taskbar to reach settings
Good luck!
I know your query was posted long ago but I have found the solution to remove the Read-Only blocker and update the excel document via Macro:
If you add "ActiveWorkbook.LockServerFile" after the code of opening the file, then it removes the Read-only and updates the excel as normal.

Excel 2010 - ActiveX controls

I've been having this problem for two or three weeks now.
Any file I create with ActiveX controls that must run a code for example clicking on a button, will work fine on my computer, but on any other computers will not work.
If you save the file, from other computer, it will show a Unexpecter error 32809 and after you close the file and reopen it, the controls will work.
Note that this happens for every file I save from my computer. Even if I get a working macro, I open it and save it with no changes, on other computers will not work.
I deleted many times *.exd files as a suggest from Internet, but still no good.
Can anyone help me with this problem, please ?
Thank you
Do a wildcard search for exd files (search for *.exd) and make sure you are not searching for exe!. Delete all the exd files returned from the search. That will do it.

Resources