Macro to export modules does not work

renatoab

New Member
Joined
Jun 14, 2009
Messages
32
I want to have text files (.bas, .cls) with the updated version of my codes in a xls file.
I guess I can't do a reference from the xls to the files and run the codes from the text files. The code must be in a module in the xls.
So my idea was to write a Sub Workbook_BeforeSave. So, everytime I save the xls file, it would run the code inside it. And there I would put a macro to export my modules.

I have searched macros to export my modules, but they don't work for me.
They are based on the VBProject property of ActiveWorkbook (or ThisWorkbook). (One example is in http://edndoc.esri.com/arcobjects/9.0/Samples/Application_Framework/ExportVBACode.htm)
I enabled the needed reference to do this ("Microsoft Visual Basic For Applications Extensibility").

But when I run, I get a message that the access to the VB project is not reliable.
Is there anything I can do?
Thanks

Using:
Excel 2003
Windows XP
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Go to Tools-Macro-Security-Tick the "Trust VB Project" checkbox under the second tab.

Regards.
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top