Manually Opened Excel Instance Interferes with Excel OLE Automation from VB
Posted on 2007-03-26
I have a problem with OLE Automation with Excel from VB 6.0 Pro. I have several procedures that send data to Excel to create reports. Some of them take a little while to create and the users work on other things while they are running. If they go to My Computer / Explorer and double-click on an Excel file it will open in the instance of Excel VB opened and interfere with the report running. This is how I declare my Excel related variables:
Set oxl = CreateObject("Excel.application")
Set oBook = oxl.Workbooks.add()
Set oSheet = oBook.Sheets("Sheet1")
Is there any way to avoid this problem, other than tying the users' hands down while their reports are generating?