-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
472 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/***************************************************************************** | ||
* | ||
* An example of adding macros to a libxlsxwriter file using a VBA project | ||
* file extracted from an existing Excel .xlsm file. | ||
* | ||
* The vba_extract.py utility from the libxlsxwriter examples directory can be | ||
* used to extract the vbaProject.bin file. | ||
* | ||
* Copyright 2014-2018, John McNamara, jmcnamara@cpan.org | ||
*/ | ||
|
||
#include "xlsxwriter.h" | ||
|
||
int main() { | ||
|
||
lxw_workbook *workbook = new_workbook("macro.xlsm"); | ||
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); | ||
|
||
/* Add a macro that will execute when the file is opened. */ | ||
workbook_add_vba_project(workbook, "vbaProject.bin"); | ||
|
||
worksheet_write_string(worksheet, 0, 0, "Overwrite this", NULL); | ||
|
||
return workbook_close(workbook); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.