Export all VBA code to text file

grahamj42

New Member
Joined
Jan 27, 2011
Messages
13
I have 2 versions of the same spreadsheet from a 3rd party.

The visual changes are easy to see but I need to check if there are code changes.

The logicical process seems to be to export all code from each app to a text file and the run the 2 text files through a file compare program.

Can this be done, please?

Graham
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi Graham

Can't help you with a program to use for the comparison, but certainly VBA module contents can be exported into a text file (right-click on the module in the Project window of the VBE and select Export. You export it as a .bas file but these are simply text files that can be opened in a text editor eg Notepad.
 
Upvote 0
Thanks Richard

I forgot to state in my post that I'm using Excel 2007 + Win XP.

You solution works fine for Modules but when I try it on the Objects (Sheet code) it exports .cls which don't appear to be readable.

File comparison isn't a problem - I use an ancient version of CompareIt - I'd be lost without it.

Graham
 
Upvote 0
I just tested both the links I posted and they worked okay. You should get a prompt "Do you want to open or save this file?" and you save it to disk and then open it from there.

Is it blocked by a corporate firewall perhaps?

If you're still experiencing problems, PM me your address and I'll email them to you.
 
Upvote 0
I created a .NET component to read XLSM files.
The webpage is here Extract XLSM and XLAM VBA Source Code

I was able to extract all the VBA code from your browse_vba_code_v2.xlsm file using it.

corrupted.png
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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