• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to create a macro that open multiple Excel files. . ..

James989

Member
Hi,

.....and automatically run the macro in each file ?

I have five different excel files and stored in :-

c:\temp\file1.xls
.
.
.
c:\temp\file5.xls



Regards


James
 
For a single time..
Open all the file.. in same excel instance..
Arrange the file's position if required..
In View menu.. Save Workspace.. and give it a desired name..

Next time.. just simply opne the Workspace.. it will open all the file with same setted position..

PS: Is really VBA required.. !!
 
For a single time..
Open all the file.. in same excel instance..
Arrange the file's position if required..
In View menu.. Save Workspace.. and give it a desired name..

Next time.. just simply opne the Workspace.. it will open all the file with same setted position..

PS: Is really VBA required.. !!

how to make sure macros in each file will run automatically once open the workspace ?
 
No.. its not a problem with Workspace.. its problem with your setting..
All files need to "Enable content" upon open. So you have to click each "Enable Option" option..
or
Go to excel Option > Trust Center > Trusted Location > Set the desired folder (in your case c:\temp\) as a trusted location it will not ask to "enable macro" for those files..
 
No.. its not a problem with Workspace.. its problem with your setting..
All files need to "Enable content" upon open. So you have to click each "Enable Option" option..
or
Go to excel Option > Trust Center > Trusted Location > Set the desired folder (in your case c:\temp\) as a trusted location it will not ask to "enable macro" for those files..


I have added the trusted location(c:\temp\) but once open workspace, still only 1 file running. Please help !

Attached herewith 2 files for your testing.
 

Attachments

Hi, James989!
Give a look at the uploaded file. You'll find there the 2 fixed files (Workbook_Open), the used workspace (workspaceando.xlw) and a printscreen of the immediate window pane. The only issue is that the workbook 1 always runs twice.
Regards!

@Debraj(ex-Roy)
Hi!
Got work...
Regards!

@r1c1
Hi!
Would you please enable .rar files as uploadable file types too? The upload dialog only has .zip ones. Thanks.
Regards!
 

Attachments

1) Both wookbooks run simulteneously OR wookbook1 first and then follow by wookbook2 ?

2) why wookbook1 always runs twice ?
 
Back
Top