PDA

View Full Version : Open/Activate other Excel files from one



Daniel2001
02-05-2008, 01:05 AM
I have one "Master" Excel file which opens/activates other 4 excel files at specific time.(using ontime). The other 4 files are wriiten to acutally get date inside them updated when they are open (by workbook_open() ). When I run the 4 files seperately,they are fine. But using this master file, ONLY one file out of 4 can be updated! only one specific file..idon't know why?? and the other 3 files are open and activated(i can see screen updating),but they don't actually get updated!!how come?

the code in Master file is like:

dim wrkbook1 as workbook
dim wrkbook2 as workbook
dim wrkbook3 as workbook
dim wrkbook4 as workbook

set wrkbook1 = workbooks.open( path of file 1)
wrkbook1.activate

set wrkbook2 = workbooks.open( path of file 1)
wrkbook1.activate

set wrkbook3 = workbooks.open( path of file 1)
wrkbook1.activate

set wrkboo4 = workbooks.open( path of file 1)
wrkbook1.activate


end sub

Thanks for any help!!!!!!!

Bob Phillips
02-05-2008, 01:07 AM
If you updating it using ACtiveworkbook, maybe that is the problem, the active workbook may be the same all the time.

Daniel2001
02-05-2008, 01:21 AM
Hi, xld

Thanks for your swift reply..that is probably right..i will try it

however, i don't know how to write that!

the code inside the 4 files to update is like
-----------------------------------

sub workbook_open()

Application.run "ecowinupdate" <---this line updates date
' some other code manipulating cells
end sub

------------------------------------
there is only one line for updating date. And this "ecowinupdate" is a add-in. it connects ecowin database with my excel.

each of the 4 files are same! just different set of data..

can you tell me how to add that Activeworkbook to that "application.run "ecowinupdated"??

thannks so much!

Daniel2001
02-05-2008, 01:34 AM
Hi xld,

by the way, it is kinda weird, that the speicif file that gets updated is put in the last order , i mean "set wrkboo4 = workbooks.open( path of file 1)
wrkbook4.activate" i actually run the other 3 files first....

and no matter how i change the order of runing them...still that file gets udpated..

so i guess it has something to do with that "application.run ecowinudpated"

since in each workbook, there is such a line "application.run ecowinudpated". all same...the difference is that all the codes is written in sub workbook_open in the file that gets updated. In other 3 files, this line is written in stardand modules which would be called from workbook_open.
that is
sub workbook_open()
call updating
end sub

in the moduel

sub updating()
application.run "ecowinupdated"
end sub


does this matter?