How to get files in Mac equivalent of XLSTART folder to be opened "invisibly" - excel

I have a Utilities file which contains a number of macros which I use a lot. My old Excel loads this file on launch, but does not show the window. This is exactly the desired behaviour.
However I recently updated my Excel (16.56 on Big Sur) and now, when Excel launches, the window shows.
Is there any way to make it be invisible? I've tried deleting all the worksheets but Excel won't let me. Googling is throwing up scads of completely useless hits and nothing here seems to be relevent, either.

OK, so after much more Googling, I found the answer. Menu item Window -> Hide. Then quit Excel, answering Yes to save the file. On relaunch it opens invisibly.

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.

Cannot open an excel file for which I clicked view > hide on mac. All the other files open just fine

I cannot open my excel file, for which I clicked view > checked "hide" when I had the file open previously.
As soon i did that, the file stopped displaying. Every time I click the file, Excel software starts running, so I don't think there is anything wrong with the software itself, just a problem with this specific file. All the other excel files would open when I click them, except this one.
I am using a macboook pro.
Could anyone please help me how to undo the action I did? Thank you.
The view-hide literally hides the file from being seen when opened and I didn't know that....

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 crashes when pressing "developer tools" button

I have the following problem in Excel:
I wasdevelopping a template in Excel VBA. I was tearing a sub routine in break mode and tried to stop it to change the code. When I pressed the stop button, however, Excel froze so I had to kill the process. Although before the crash everything was ok, opening the file would cause excel to freeze and crash again. Obviously the file got corrupt. I used a previous version of the file and decided to redo the changes. At some point the problem happened again. When I finally managed to open the file, everything seemed ok, but pressing the "developer tools" button on the ribbon crashes excel. I desperate. The Template is 90% but making even the slightest change feels like disarming a mine bomb that can blow the template up.
Does anyone know how to bypass the problem?
Here is what I would suggest:
get another PC with the same version of Excel installed,
Install the VBA CodeClener Add-in (http://www.appspro.com/Utilities/CodeCleaner.htm),
Copy your (prior) spreadsheet over to that PC, open it, open developer tools and run CodeCleaner.
Add your changes.
If that works, then reinstall Excel on your first PC. If not then you will have to take drastic measures:
Open the prior version,
Make one (or a few) change at a time,
After each small set of changes, save a new version of your Excel file, adding a version number to the file name (update the version/file name each time)
If it fails again, go back to the previous version, and the try to figure out which of the small set of changes may have corrupted the file.

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