Consulting

Results 1 to 3 of 3

Thread: Add-in question

  1. #1

    Add-in question

    Hi,

    I have a workbook, named wrk1 ,getting data updated via Addin ( from database). This workbook run fine manually.

    But when I use wrk2 to open wrk using following code

    [VBA]
    workbooks.open("wrk1.xls")
    [/VBA]

    wrk1 is opened,and executed (code is in workbook_open()),but data not updated....does it has anything to do with Add-in limitation ?

    Thans for any advice!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Can you post a bit more detail?
    ____________________________________________
    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
    Thanks xld

    Here is the detail.

    my guess is the Reference problem in VBA.

    there are two workbooks, wbk1 and wbk2 ,both contains vba code
    application.run "ewupdateall"
    'code to generate graph based on the data
    in the workbook_open event


    "ewupdateall "is an Add-in from Financial database. When I open wbk1 or wbk2 seperately manually. both of them work fine.

    Problem arises when I creat a "master" workbook to open wbk1 and wbk2 one by one. only one workbook (say wbk1) updates data, wbk2 also opened,and run,but not update new data.Looks like the the code application.run "ewupdateall" doesn't work in wbk2

    code in "master" workbook is:
    [vba]
    sub wkb1()
    workbooks.open (path of wkb1)
    activeworkbook.save
    activeworkbook.close
    application.ontime now+timevalue("00:00:30"), "wbk2"
    end sub
    sub wbk2()
    workbooks.open (path of wkb1)
    activeworkbook.save
    activeworkbook.close
    end sub
    [/vba]

    weird thing is that , no matter i run wbk1 or wkb2 first , it is always wbk1 updates data! the code inside wkb1 and wkb 2 are same basically!
    any idea?

Posting Permissions

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