Good Morning. I made a PHP script to generate an .xlsx file containing some charts in different sheets.
I used a self-made PHP framework using COMPOSER and libraries such PHPSPREADSHEETS (version 1.23)
It worked fine till some months ago.
Now I noticed that when the script generate the .xlsx file, opening with office Excel, I get a warning telling me that there are some problem with part of content and after another one:
Records restored: Drawing from the part /xl/drawings/drawing1.xml
(Draw shape)
Clicking OK anyway the file (and charts) are showed correctly.
I also tried to save the file from Excel with "Save as" and the new file is opening without warnings.
I searched online this issue but I didn't find anything to solve this.
Anybody had the same problem?
The same problem is happening using the default example by PhpSpreadsheet: link
Related
I've been running a workbook with a few macros in it for a couple of years, and I've suddenly started getting this error thrown at me for some navigational buttons (shapes linked to macros that are simply ThisWorkbook.Sheets("sheet_name").Activate).
Other Macros within the workbook seem to work OK, but I can't get into the VBA editor to see any of the code anymore - I get to the VBA interface, but when I go to open the Module, nothing happens.
And to cap it all off, when I try to save the workbook, I'm just getting an error saying 'Document not saved'.
I had the same issue. I opened the VBA code module and then selected Debug then Compile VBAProject. I then closed the Visual Basic Editor and the error seems to have been resolved. Have only had the issue the once so can't be 100% sure it will work in every instance but worth a go.
Suggest you open a backup copy of this file (if you have one), export the broken module and then in your current file, remove the broken module and import the clean version.
We had the same problem in a file that was drawing data from an external source and saving itself automatically every minute. What worked for us was just replacing the entire file with a backup from 2 days ago.
We also had the "Document Not Saved" error, which was solved by upgrading the file from .xls to .xlsx
Just came across this error - for me it seems to affect any code opening docs via external links. Ran the debug suggested above and fixed issue.
i just recieved an e-mail with a virus embeded in xlsm format. So how i'm curious i wanted to check the code. Enabled everything of security on Excel to avoid events starting and other stuffs after opening the contamined file.
Kaspersky flagged the file instantly so i had to disable it.
So i opened the file, and excel showed me a prompt that i had to need disable some security features for the macro run normally. Well, i just ignored it and i went to the vba area to check the code and i found some modules, but every was empty.
Someone can explain me how is it possibile and if there's a way for me check the code?
Thank you.
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.
I created a simple vba addin that colors cells based on their value, and I created a function that calls it with a shortcut then I saved it as an Excel addin and added it to Excel.
The problem is the addin works fine when I add it the first time, but when I open a new Excel file, I need to disable and enable the addin for it to work.
Update: I tried it on another computer and it works, but it shows an error that when I ignore it works fine. I am adding screenshots for the error and code
Error Message
Code
Sometimes, Excel will open workbooks in another Excel Application. This second application can sometimes face some issues with addins. You should double-check that the new file is opened in the same Excel Application. By looking at the task manager:
In this example, I'm using Window 10 and you can see that Book3.xlsx is in a different Excel Application than Book2.xlsx and Book1.xlsx
EDIT:
This question could also be of interest to you. The accepted answer reads:
This problem results from security patch in KB31152, released in July 2016. According to private communication with Microsoft software engineers:
"With this update, we changed the behavior of Excel so that it will
not load certain file types (including .xlam) when they are untrusted.
The easiest workaround is to find the add-in that is causing you
trouble, right-clicking on it in Windows Explorer, and checking
Unblock"
An easier approach is to simply place the add-in in a Trusted Location
(in Excel, go to File > Options > Trust Center > Trust Center Settings
Trusted Locations), such as the following folder, and load it from there:
C:\Users\%USER NAME%\AppData\Roaming\Microsoft\Excel\XLSTART
EDIT2:
And don't forget the option of just restarting your computer just to make sure that the problem is still there.
Good afternoon. It so happened that for several years I have kept notes on programming in large Excel files with through the table of contents. All code is illuminated to every part of the code you can instantly get there thanks to hyperlinks within the document. Everything was fine until after I moved to Ubuntu by working necessity. In linux there are several options - Libre Office, Open Office and work with MS Office under Wine.
While none of these options could not solve the underlying problem.
When you copy data from the IDE PhpStorm captured lighting, it is very important to quickly understand code. So - when you insert data in Libre Office everything is inserted into a single cell and read a large piece of code more than one screen becomes impossible. Either one line - but without syntax highlighting.
Today I installed Wine, PlayOnLinux, MS Office 2010, everything seems nice and cool - but when copying data from the clipboard into the linux Vine insertion error occurs. The data can only be inserted in the format of a naked text without highlighting.
If anyone knows how to solve my problem - I shall be grateful for your help.
Maybe there are some other alternatives Excel to store large, complex synopses?
As far as I recall Libreoffice will read the excel file without changing anything, just tell libreoffice to open the excel file.
If libreoffice doesn't recognise the xls suffix, use "open with".
You can always tell libreoffice to save the xls file as a libreoffice spreadsheet later, as I imagine that Phpstorm simply uses the same method to decide what to use to open a file as everything else.
If some reason you are still having trouble, investigate unoconv which is available in the repositories.