0
votes

I wish to activate legacy VBA code when opening a document using office.js

https://docs.microsoft.com/en-us/javascript/api/word/word.application?view=office-js#createdocument-base64file-

On MAC autoopen/autonew does not kick-in.

Anyone with good solutions to this?

1
If I understand correctly you would like to open a document via office.js. When this document is opened, some legacy VBA code needs to be run. The VBA code runs fine, when this is done on Windows, but does not happen when you try it on Mac? Either way, please provide some more information. This is too little to help you. Are there errors, did you do any research yourself, et cetera.Fluous
You are spot on! On windows everything is good. On MAC, the VBA can run, but is not executed. I am trying to identify the best possible way to trigger legacy code when opening a document from the app.Morten Hald Mortensen
Does the VBA code run when you open the document manually (i.e. without opening it through createDocument method of Office.js)? What I am trying to discern is whether Office.js opens the document differently than when a user opens it.Fluous
Yes, it runs manually - no problems there. It is the "open" from Office.js that is the only issue.Morten Hald Mortensen
My guess would be that this is a bug or restriction from Office.js, if there are no other messages or errors. You could try posting an issue on their github. I am not able to help you any further without anymore information.Fluous

1 Answers

1
votes

For future reference: as discussed on a related GitHub issue, this feature was disabled on Mac Word, and will likely be disabled on the Windows client as well.