Excel for Mac gives "cannot open file... format or extension not valid" error for custom add-in when pulling from git

0

I am currently working on a custom Excel add-in which, until now, was only used on Windows. I am attempting to make it cross-platform. Unfortunately, when I pull my add in from git and attempt to load it in Excel on my Mac, I receive an error:

Alert

Excel cannot open the file 'myfile.xlam' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

I then receive a second message box that states:

Microsoft Excel cannot access the file 'myfile.xlam'. There are several possible reasons:

  • The file name or path does not exist.

  • The file is being used by another program.

  • The workbook you are trying to save has the same name as a currently open workbook.

Regarding possibility 1, I know the file exists because I just pointed the add-in settings to it. As far as possibility 2, to the best of my knowledge there is no other program using the add-in, and I don't see how there could be. I have used lsof to check and the file is present nowhere on in the list. Regarding 3, I am not trying to save the file, and this file is not even open anyway, so this can't be the issue.

My am running Excel 16.27.

I also have checked that the file format and extension are valid and that they match each other. I have expanded the file's privileges to include read, write and execute for everyone, both once pulled to the mac and on Windows before pushing the file to git.

Curiously, if I move back to my Windows machine, set isAddin = False and save the file as an xlsm file, I can send it to my Mac machine, open it in Excel with no problems, set isAddIn = True and save it as an xlam on that machine. It will then load the add-in without any issue, as long as I save it where I intend to keep it. If I move the file elsewhere it becomes a gamble as to whether or not it loads. For example, after doing this, the files did not load at first and then loaded later on.

I'm guessing this issue has something to do with Excel on Mac having stricter security protections when it comes to files not created on its system, but if this is the case, I'm not sure how to address it. In the security settings I have set Macro Security to "Enable all macros", Developer Macro Settings has "Trust access to the VBA project object model" checked, and Document-specific Settings has "Use Microsoft online service to open certain files" checked.

I'm at a loss as to where to go from here, and I'd really appreciate any input anyone has in an attempt to address this issue. Thanks in advance.

Blake Simmons

Posted 2019-08-02T21:19:17.767

Reputation: 31

No answers