Is it possible to view a VBA project without opening the excel file

jjzhang

New Member
Joined
May 23, 2009
Messages
44
I'm trying to get some information from a excel project, but the file that contains the project is not opened. Is it possible? How? Thanks in advance for advices. --JJ
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
In one word: No

in order to even get one charater from a file, it needs to be opened, if not by the application itself then by another application. To see a thumbnail of a file in Windows Explorer for instance the file had to be opened to get an image.

So if you want to read the vba of an excel file, the file has to be opened. You can use Excel for that and look at the code the normal way, or if you know the structure of a spreadsheet than you can write your own application to just extract the vba. Or you can look at it with a hex editor.
 
Upvote 0
In one word: No

in order to even get one charater from a file, it needs to be opened, if not by the application itself then by another application. To see a thumbnail of a file in Windows Explorer for instance the file had to be opened to get an image.

So if you want to read the vba of an excel file, the file has to be opened. You can use Excel for that and look at the code the normal way, or if you know the structure of a spreadsheet than you can write your own application to just extract the vba. Or you can look at it with a hex editor.

Sijpie:

It seems to be a little too much for me to understand or to try out what you said, but I will try your suggestions out. Thanks a lot. -JJ
 
Upvote 0
In one word: No

in order to even get one charater from a file, it needs to be opened, if not by the application itself then by another application. To see a thumbnail of a file in Windows Explorer for instance the file had to be opened to get an image.

So if you want to read the vba of an excel file, the file has to be opened. You can use Excel for that and look at the code the normal way, or if you know the structure of a spreadsheet than you can write your own application to just extract the vba. Or you can look at it with a hex editor.

The excel file contains an auto_open method. If I open it using macro from within a different excel file, will the auto_open sub excute?. Thanks again.
 
Upvote 0
Why not try it and see? That way you get the definitive result on your own without having to rely on someone else doing the same testing!
The excel file contains an auto_open method. If I open it using macro from within a different excel file, will the auto_open sub excute?. Thanks again.
 
Upvote 0
Why not try it and see? That way you get the definitive result on your own without having to rely on someone else doing the same testing!

Another question: Is is possible to run auto_open automatically if the file is opened by a sub from another file? Thanks. -JJ
 
Upvote 0
Check Excel VBA help for the worksheet.open method. It contains information on how to control manual / automatic code execution.

Another question: Is is possible to run auto_open automatically if the file is opened by a sub from another file? Thanks. -JJ
 
Upvote 0
FYI, if you don't want Auto_Open and other event procedures to execute automatically when opening/manipulating an Excel file programmatically, you can wrap the call to the Workbooks.Open method in EnableEvents, like:

Code:
    Application.EnableEvents = False
    Set wb = Workbooks.Open(fileName)
    Application.EnableEvents = True
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,552
Members
449,088
Latest member
davidcom

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