I have an Excel Office 365 file that immediately crashes upon opening.
The file contains VBA modules that do not have a backup. I would like to extract the VBA modules without opening the file.
Is there a way to read the contents of the VBA modules and save them for reuse in a new file?
Kudos to Bigben , i opened excel in safe mode and was able to recover my code modules.
Although it does not answer the question i originally posed ie: is there a way to read the modules without opening the file", it achieves the same intent. Thank you BigBen
Related
I have a problem with opening an old excel file with VBA macros. It looks like some of the VBa libraries are no longer used in excel 365.
While opening I get an error:
Opening the VBA project in this file requires a component that is not currently installed. This file will be opened without the VBA project. Fro more information, search Office.com for "VBA converters"
I struggle to install those libraries on my PC, but in the meantime I wonder if there is any workaround to get the VBA code out of this file.
Thanks in advance!
EDIT:
I attached mentioned file.
https://docs.google.com/spreadsheets/d/1msKl4kZANwwOTcqkDDb6pUjaaYkZ57lS/edit?usp=sharing&ouid=105093812803215551016&rtpof=true&sd=true
You can solve your problem when install office2003 and save it to microsoft office excel workbook(*.xls)
Link for office 2003
Your file after convert
Thanks for Mr.Yasserkhalil
I'm getting more and more Sheets in my workbook?
Does anybody know how I delete these additional sheets?
I'm running excel 365 and the file is located on a sharepoint.
Any help is appreciated.
Ok. I haven't had any luck regarding this issue. However, I found others dealing with the same issue. The solution I came up with might help, and is quite simple:
Save the document as a xlsx file. This deletes the phantom sheets. Then manually transfer forms and macros and save the document as an xlsm file. Not a pretty solution. But it works.
I have a xlsm file that today I opened and i can't reach the macros in it.
Any idea what could have happened?
I think i answered it rather quickly after searching here:
https://www.excelforum.com/excel-general/1112769-corrupted-microsoft-excel-macro-enabled-workbook-xlsm-file.html
I was just introduced to VBA. However, on saving my first excel file with VBA code, with .xlsm extension (I was advised to do so), and then reopening that saved file, I realized that all the VBA code had disappeared and the cells in which I had used the user-defined functions threw errors. Saving the workbook as .xlsx instead of .xlsm also didn't help. When I tried saving the VBA module, it showed that FUNCRES.XLAM is read-only and hence cannot be modified, and so try saving it at a different location. Doing so, saved an excel file which on opening showed a pop-up message that it's corrupt so can't be opened. Then I gave all permissions to FUNCRES.XLAM and it is NOT read-only. But the problem still prevailed. What should I do? Can someone please help me?
PS: It is Windows 10, Office 2016.
Your VBA code needs to be saved in a module within the same workbook in which you are working. This will probably be listed as VBAProject(Book1)
There will likely be other projects listed in the Project Explorer window of the VBA GUI, but your code will not get saved with those modules.
These are related to add-ins, and not to your workbook.
My excel code was able to iterate through every workbook in a specified folder, although it does so in an eternal loop. (Which i stop using the keyboard interrupt)
Vba based off this: http://www.ozgrid.com/VBA/2007-filesearch-alternative.htm
Now, after switching PCs, the code has gone haywire. The vba is still the same but instead of opening workbooks in the specified folder, its opening workbooks in the folder one folder before it.
E.g Vba is in S:\Excel\Test
It will open books in S:\Excel
Instead of a specified location in C. Drive S is a networked drive
Not only that, while it used to iterate through EVERY file, it now just keeps resetting and opening the first file again and again
Using Excel 2007
Guys the answer is simple. Because im using a networked drive, one should refer to the drive on which the workbook is stored. Adding one line to the top above ChDir solves this
ChDrive (Left (ThisWorkbook.Path, 2))
Im also glad to report that this question did not require me posting my code as well.