VB to Excel communication
Posted by Guru on February 27, 2001 7:03 AM
Problem:I want to know if an instance of Excel already exists on my system thru VB code or I want Excel to inform my VB program that it is being closed whenever Excel is closed. In other words, I want to avoid Excel opening anew for each report triggered by VB.
In my application for Excel reports I am using Visual Basic as front end and MS Access as backend. From VB, I am accessing the database, doing the required calculations, creating an instance of Excel object, placing the data in an Excel worksheet and finally preparing the chart in Excel. Opening of Excel, placing data in it, drawing chart is all done thru VB code. The above process is repeated for each report I select from VB. But I want to avoid creating a new instance of Excel for each report (reports are selected randomly from a list). So through VB code I want to know if an instance of Excel already exists on my system or I want Excel to inform my VB program that
it is being closed whenever Excel is closed.