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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Go to Tools-Macro-Security-Tick the "Trust VB Project" checkbox under the second tab.

Regards.
 
Upvote 0

Forum statistics

Threads
1,215,504
Messages
6,125,185
Members
449,213
Latest member
Kirbito

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