+ Reply to Thread
Results 1 to 3 of 3

Automating Excel with add-in

  1. #1
    Nick S.
    Guest

    Automating Excel with add-in

    Hi all!

    I have the following problem with automating Excel 2003.

    I automate it from WSH. The idea is to open a workbook (wkbk.xls),
    wait for a definite amount of time (30 sec.),
    then save it and close Excel.

    Using standard procedure (in a VBS script):

    wkbk = "...path...\wkbk.xls"
    set oExcel = CreateObject("Excel.Application")
    oExcel.Workbooks.Open wkbk
    WScript.Sleep 30000
    oExcel.ActiveWorkBook.Save
    oExcel.ActiveWorkBook.Close
    oExcel.Quit

    everything works as expected.

    The problem is that Excel is setup on my computer with an add-in
    that fetches some data from the internet while the wkbk.xls is open.

    If I double-click wkbk.xls this operation is performed OK,
    while if wkbk.xls is open by the above script, it is not:
    if (during the 30 sec. period) I check Tools -> Add-Ins
    the add-in is not even listed among the Add-ins available.

    How can I force the Excel aplication object to be "started"
    with the required add-in?

    TIA,
    Nick

  2. #2
    Nigel
    Guest

    Re: Automating Excel with add-in

    Have you tried adding the add-in into the workbook.open event ?

    AddIns("MyAddInName").Installed = True


    --
    Cheers
    Nigel



    "Nick S." <[email protected]> wrote in message
    news:[email protected]...
    > Hi all!
    >
    > I have the following problem with automating Excel 2003.
    >
    > I automate it from WSH. The idea is to open a workbook (wkbk.xls),
    > wait for a definite amount of time (30 sec.),
    > then save it and close Excel.
    >
    > Using standard procedure (in a VBS script):
    >
    > wkbk = "...path...\wkbk.xls"
    > set oExcel = CreateObject("Excel.Application")
    > oExcel.Workbooks.Open wkbk
    > WScript.Sleep 30000
    > oExcel.ActiveWorkBook.Save
    > oExcel.ActiveWorkBook.Close
    > oExcel.Quit
    >
    > everything works as expected.
    >
    > The problem is that Excel is setup on my computer with an add-in
    > that fetches some data from the internet while the wkbk.xls is open.
    >
    > If I double-click wkbk.xls this operation is performed OK,
    > while if wkbk.xls is open by the above script, it is not:
    > if (during the 30 sec. period) I check Tools -> Add-Ins
    > the add-in is not even listed among the Add-ins available.
    >
    > How can I force the Excel aplication object to be "started"
    > with the required add-in?
    >
    > TIA,
    > Nick




  3. #3
    P. Bradac
    Guest

    Re: Automating Excel with add-in

    Thank you very much for the hint, Nigel.

    In the meantime I bumped into another problem. I found out that
    installation of an add-in is bound to the user logged-in: it is
    registered in HKEY_CURRENT_USER not in HKEY_LOCAL_MACHINE.

    As I intended to run the script as a scheduled task when nobody is
    logged in on the computer I have great doubts whether it could work...

    If you happen to have an idea how to do it anyway, please, let me know.

    Regards,
    Nick

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1