Consulting

Results 1 to 4 of 4

Thread: Open/Activate other Excel files from one

  1. #1

    Open/Activate other Excel files from one

    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!!!!!!!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    If you updating it using ACtiveworkbook, maybe that is the problem, the active workbook may be the same all the time.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    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!

  4. #4
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •