Creating an xlsm from an existing xlsm loses macros #606
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#606
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm attempting to modify an existing xlsm file using SheetJS and running into this issue. After reading in the information, making my changes, and then writing it back out, it doesn't keep the macros on the new file that's created. Is there a way to copy the macros from the original xlsm to the new xlsm file?
@johnothetree the current version does not round-trip macros, but fortunately this is really easy to fix! Feel free to make the change and submit a PR:
in the bits/30_ctypes.js file, after the line
f3('themes')
add a linef3('vba')
. This tells the writer to include an entry in[Content_Types].xml
in the file bits/86_writezip.js add the following just before the line
zip.file("[Content_Types].xml", write_ct(ct, opts));
:bookVBA:true
. For example, if you are usingXLSX.readFile
, you could write something like `XLSX.readFile("filename", {bookVBA:true, /* .. other options */});@johnothetree we just pushed the aforementioned changes and they will appear in the next release
@SheetJSDev perfect, thanks! any idea when the next release will be? or should i go ahead and manually add the changes locally as it'll be a lil while yet?
we're aiming for Friday.