# Vbscript to open excel and let calculate



## mario92 (Apr 10, 2020)

Hi,

I need to write a script to open an excel file and then just stop and let the bloomberg links in the spreadsheet update/calculate.  The problem is once it is open the links wont update as it seems excel is in some sort of edit mode.  I've tried to write something in just vba (with excel) and not have any luck allowing bloomberg to update.  I've researched it quite a bit and have tried versions of vba with do event or application.wait and nothing seems to work.  I thought if i could open with a script i could call another vba program to do the rest (resave values and save) any suggestions would be helpful.....

create the excel object
    Set objExcel = CreateObject("Excel.Application") 

'view the excel program and file, set to false to hide the whole process
    objExcel.Visible = True 

'open an excel file (make sure to change the location) .xls for 2003 or earlier
    Set objWorkbook = objExcel.Workbooks.Open("H:\Alt Marketing\Alt Team summary Template\Alts Performance Template.xlsx")

'release objects
    'Set objExcel = Nothing
    'Set objWorkbook = Nothing

    Wscript.quit


----------

