VBScript Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tristend
    New Member
    • Jan 2007
    • 1

    VBScript Question

    Hi.

    I may be posting this in the wrong section, if I am I apologise...

    I am using some VBscript to open an excel spreadsheet, run a macro, save the spreadsheet and close excel.

    The problem I am having is for some reason the Addins used for the functions in the spreadsheet don’t appear to be enabled. I know this as some of the functions show up as #NAME? . The account that’s running the script, the admin account and local admin account all have the addin's enabled in excel and its not a macro security problem as the macros run ok.

    If I run the spreadsheet normally by just opening it in excel it all works fine. Its just when I use the VBScript it happens.


    The code im using is below.

    Code:
    Dim xlObj
    Set xlObj = CreateObject("Excel.application")
    xlObj.Workbooks.Open "Path to my spreadsheet.xls"
    xlObj.Run "Module1.Auto_Open"
    xlObj.ActiveWorkbook.Saved = True
    xlObj.ActiveWindow.Close
    xlObj.Quit
    Any help appreciated.

    Thanks
    Tristen
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by tristend
    Hi.

    I may be posting this in the wrong section, if I am I apologise...

    I am using some VBscript to open an excel spreadsheet, run a macro, save the spreadsheet and close excel.

    The problem I am having is for some reason the Addins used for the functions in the spreadsheet don’t appear to be enabled. I know this as some of the functions show up as #NAME? . The account that’s running the script, the admin account and local admin account all have the addin's enabled in excel and its not a macro security problem as the macros run ok.

    If I run the spreadsheet normally by just opening it in excel it all works fine. Its just when I use the VBScript it happens.


    The code im using is below.

    Code:
    Dim xlObj
    Set xlObj = CreateObject("Excel.application")
    xlObj.Workbooks.Open "Path to my spreadsheet.xls"
    xlObj.Run "Module1.Auto_Open"
    xlObj.ActiveWorkbook.Saved = True
    xlObj.ActiveWindow.Close
    xlObj.Quit
    Any help appreciated.

    Thanks
    Tristen
    Hi Tristen.
    You may get answers here, but may have better results on the VB forum.

    Comment

    • Andreyka
      New Member
      • Feb 2007
      • 1

      #3
      Hello Tristend,

      I have the same problem (FactSet, Bloomberg addins, etc.). The reason is that CreateObject method starts Excel application "clean" of all addins (so you can not run any sub, function or formulas that located in these addins).
      I am looking for additional method call to add everything to it from VBScript.

      Did you find any answers?

      Thank you.

      Comment

      • Question123
        New Member
        • Feb 2008
        • 41

        #4
        Hi Andrekya

        I am trying to develop windows application with C#.Net. With using Bloomberg API.
        But i am unable to get Industry specific data from bloomberg. such as (Top Performing Industries,Wors t Performing Industries ,1 Day PriceChange %,MarketCap)


        Plz help me.

        Comment

        Working...