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.
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.
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
Check Excel VBA help for the worksheet.open method. It contains information on how to control manual / automatic code execution.
Application.EnableEvents = False
Set wb = Workbooks.Open(fileName)
Application.EnableEvents = True