Forum Discussion

lrbehmer's avatar
lrbehmer
Contributor
13 years ago

Runtime Error opening Excel Spreadsheet

When I run this code, I get intermittent runtime errors:

   var Excel ;

   Excel = Sys.OleObject("Excel.Application") ;   

   Excel.Workbooks.Open("F:/my_spreadsheet.xlsx").Worksheets("Even Table").Activate ;




I am guessing that it's because the Excel executable hasn't finished loading into memory yet.



How can I wait for that?  I've tried playing with sys.waitprocess, but I'm not getting anywhere.

12 Replies