Cannot open xlsb workbooks with macros and custom ribbons - excel

Suddenly we are unable to open xlsb Excel workbooks with Excel complaining "Excel cannot open the file because the file format or file extension is not valid." The files are on a network drive but the issue happens if they are copied to a cloud location. The error occurs when opening the files directly from our laptops but if we use a VM (virtual machine) the files open fine and work normally. The files are xlsb with macros and custom ribbons. However at least one is xlsm with no ribbon.
There were some security patches rolled out from Microsoft which I suspect have broken something. Anyone else have this issue? reminds of a very similar event about a decade ago.

It was caused by a change in internal security. The team were configuring Attack Surface Reduction rules for test/audit but they accidentally got enabled/enforced.

Related

The {file} may have been changed by another user since you last saved it. In that case what do you want to do?

This is regarding editing a shared Excel file on a Windows 10 computer.
Context:
The excel file is sitting in a Microsoft Teams site (ie. SharePoint) and being opened in the desktop version of Excel.
To clarify, the Teams file location is mounted onto the Windows File explorer via the sync button on Teams:
I keep getting this error:
But I've not found how to avoid it.
Any ideas? I am not looking to make a copy of the file because that breaks the links I've shared to the active file. But also I don't know what changes I'd be overwriting if I choose "Overwrite changes"

Excel VBA can’t find project or library once I enable macros

I’ve done a LOT of googling about this and haven’t found anything specific to this situation. Apologies if I missed it.
I have a .xlsm workbook that has a few macros—-one to refresh connections to a Microsoft Access Database, one to refresh pivots, and one to save it to multiple locations.
When I open the file, I get the standard yellow security bar that some active content has been disabled—-but it used to just say ‘macros have been disabled’. When I check the macros, they are there.
BUT when I hit ‘enable’, there’s 2 issues:
it doesn’t enable anything and I have to go to the Trust Center to enable both Macros and External Data Connections. Before yesterday, I never had to do that.
Once I enable macros and external data in the Trust Center, suddenly I get an alert that VBA “can’t find a project or library” and all my macros are now gone.
When I reload the workbook, we’re back to where I started. I have one other workbook with this issue. The other 5 or 6 macro-enabled workbooks do not have this issue.
The issue with these docs persists across 2 other colleagues’ remote laptops. However, when I remote into the office and access the same files in the same folder using VMWare to remote into an office PC environment, they work just fine.
I have tried accessing Tools>References in VBA—-nothing happens when I click ‘References’. I have restarted. I have emailed the files from the VMWare environment to myself, and they don’t work. I have enabled all macros and data connections by selecting those radio buttons, but still have VBA throwing that error and my macros disappearing until I reopen the file.
I truly don’t understand. Can somehow the files be corrupted only when I access them from home? Is there any fix?

Launch an add-in systematically when opening a file

I want to make an Excel Online file, then post its link or embed it in my website. Clicking on that will open the file in Excel Online. Moreover, I want certain Excel add-ins to be installed and even launched automatically.
Does anyone know if it is possible?
If it's impossible with Excel Online, is it possible for a normal .xlsx file (I will make it, and opening it in Windows systematically leads to install an add-in and even launch it)?
If you're looking to automatically open a task pane add-in when the Excel file is opened, check out this article in the documentation: https://dev.office.com/docs/add-ins/design/automatically-open-a-task-pane-with-a-document?product=excel. The Office OOXML EmbedAddin sample provides an example of implementing the autoopen functionality that's described in the article.
Along with Kim's answer to automatic opening of a task pane add-in, you can using OneDrive to handle opening a file in Excel Online using Microsoft Graph.
You're start by uploading you're .xlsx file to OneDrive using an Upload Session. Once you're file is on OneDrive, you can retrieve it's meta-data for the DriveItem. Included in this meta-data will be a webUrl property. This is a URL that, when navigated too, will open your file using Excel Online.

Excel VBA sharing addins between different read-only instances of same workbook

My team and I share this workbook on a network drive. This workbook utilizes a few custom add-ins necessary for some custom functionality. These add-ins get automatically installed by custom VBA code I have added without any action on the part of the user. It seems that only I can use the add-ins - other team members have problems trying to load the add-ins, they get this error:
Run-time error 1004 Unable to copy add-in to library.
The error occurs when trying to run
Application.AddIns.add(<addin_name>)
The add-ins are located only on the Windows network share. I've written the code to ignore the prompt for copying the add-in to addins folder on local drive, because I don't want this to happen. This is a very annoying problem because I cannot debug it fully myself, I need the cooperation of my team members which is limited. Help greatly appreciated, thanks.
I would suggest just opening the XLA read-only from the network drive as if it was a workbook (which of course it is) rather than using Addins.Add - opening an XLA makes it available to the Excel session so it will function as an addin without being in the addins collection.

SharePoint document library: Fail to open xlsx in Excel 2003 (with compatibility pack)

My company is using WSS 3.0 to host a document library storing (mostly) Office 2007 format documents. Company PCs have either Office 2003 (with the 2007 compatibility pack) or Office 2007 installed.
We didn't have any problem getting docx to work, but xlsx documents don't open properly when we use the SharePoint document edit options. The file opens in excel, but displays unformatted mess (close to the notepad representation). The actual files are fine, downloading the xlsx file (using the send to -> download option) allows the file to be opened. It is only when we use SharePoints 'Edit in Microsoft Excel' that we get an issue.
I think that the issue is excel (2003) trying to open the xlsx file as if it were and xls file, and being unable to represent the zipped contents. Has anyone seen this issue before?
EDIT: I've noticed that when the document is opened with explorer, it actually opens through the Microsoft open XML coverter. Clearly, SharePoint isn't using it, is there a fix that works round this?
UPDATE: I have done a bit more research, as added in the comment below this issue replicates across all machines on our network which use office 2003 and XLSX files from SharePoint. I have confirmed that using excel to open xlsx files in explorer (without the converter) results in the same issue as when they are opened from SharePoint. I think i need a way to tell SharePoint/IE (whatever actually handles the office interaction, URLMON/HLink?) that the proper file assosciation for XLSX isn't excel.exe.
Are you able to test this on another computer? Might be related to a registry entry and/or other software causing it (because you did not had problems with word). The ideal test scenario would be a brand new OS Install with only Office 2003 and the compatibility pack.

Resources