Reputation: 401
How can I save as xlsx my project? I try to do my project in excel with vba but I do know how to save it for future use. If I save as excel sheet, vba will not be saved to it, I do know how to do that save. Is there someone who has an idea to this problem?
Please anyone can help me.
Upvotes: 1
Views: 12495
Reputation: 11
Macros can be stored in individual workbooks or available for a user in all workbooks opened if they are stored in C:\Users\nnn\AppData\Roaming\Microsoft\Excel\XLSTART\ PERSONAL.XLSB.
For more info see https://support.office.com/en-us/article/create-and-save-all-your-macros-in-a-single-workbook-66c97ab3-11c2-44db-b021-ae005a9bc790
Upvotes: 1
Reputation: 964
Hello Schadrack Rurangwa**,
There a couple ways to do this.
Altenative One:
save the vba file to ".bas"
1. Click on menu Tools->Macro->Visual Basic Editor
2. This will open Visual Basic Editor
3. In the visual basic editor, select menu File-> Rightclick somewhere in the module and select export file. (save your module ".bas" somewhere).
Next time you start excel and want to use your VBA-Macro, just navigate to:
Tools>Macro->Visual Basic Editor> Rightlclick somewhere in the module and import the ".bas" file.*
Altenative two:
You could save the file Excelfile as "*.xlsm"
(A file with the XLSM file extension is an Excel Macro-Enabled Workbook file)
Upvotes: 3
Reputation: 46
xlsx only for data sheet. When you have VBA code in your excel workbook you should save as Excel Macro-Enabled workbook (*.xlsm)
Upvotes: 3