Afternoon all,
I'm using the following code in a .vbs file to create an instance of Excel, then open a VBA project in said instance.
At various point in the project, I am encountering something very odd - with no warning, error handling, anything, the workbook and Excel instance simply disappear. As in, completely. They're not hidden, the processes disappear from Task Manager, but I get no crash report or anything.Set xl = CreateObject("Excel.application")
xl.Application.Workbooks.Open "\\KWDSTR09\GRP\Samkt\Allsamkt\Dave Ulliott\Demand Analysis\EST Demand Analysis.xls"
xl.Application.Visible = True
Set xl = Nothing
This is no consistency here, I could push a button 50 times and it would do as it should 47 times... I've even encountered it a few times while stepping through my code - no debug message just a *poof* and away it goes.
I reckon it's something to do with the project being opened via this method - it only occurs when opened through the VBS script, but as you can see it's the most basic bit of code I've every seen - what could go wrong?
Any ideas??
Thanks!
Dave
Bookmarks