Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: workbook_add_vba_project() #29

Closed
jmcnamara opened this issue Dec 10, 2015 · 5 comments
Closed

Feature request: workbook_add_vba_project() #29

jmcnamara opened this issue Dec 10, 2015 · 5 comments

Comments

@jmcnamara
Copy link
Owner

jmcnamara commented Dec 10, 2015

Add workbook_add_vba_project() function like the Python XlsxWriter Workbook method add_vba_project().
See https://xlsxwriter.readthedocs.org/index.html

  • Difficulty: 3 (Easy 1 - 5 Hard)
  • Priority: 3 (High 1 - 5 Low)

Add +1 as a comment to vote for this feature and to get an update when it is implemented.

If you would like to make a donation to accelerate this feature you can do so via PayPal or contact me directly. Currently $0 of $300.

@jmcnamara jmcnamara self-assigned this Dec 10, 2015
@jmcnamara jmcnamara added this to the Phase2 milestone Dec 10, 2015
@nelson2005
Copy link

+1

@jmcnamara jmcnamara modified the milestones: Phase4, Phase3 Jan 12, 2017
@jmcnamara
Copy link
Owner Author

jmcnamara commented Aug 6, 2018

Since I've had a few requests about this I've added a note about making donations to prioritize this feature.

jmcnamara added a commit that referenced this issue Jun 16, 2019
Initial support for adding macros extracted from existing xlsm
files to new xlsm files.

Issue #29 add_vba_project()
@jmcnamara
Copy link
Owner Author

I've pushed an initial version of this to master. You will have to use the Python vba_extract utility (installed with xlsxwriter) for now.

Here is an example:

#include "xlsxwriter.h"

int main() {

    lxw_workbook  *workbook  = new_workbook("test_macro01.xlsm");
    lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);

    workbook_add_vba_project(workbook, "vbaProject01.bin");

    worksheet_write_number(worksheet, CELL("A1"), 123 , NULL);

    return workbook_close(workbook);
}

@jmcnamara
Copy link
Owner Author

Added docs and an example file.

@jmcnamara
Copy link
Owner Author

Added in version 0.8.7. See https://libxlsxwriter.github.io/working_with_macros.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants