![]() |
activating excel from VB
Hello there,
I'm running a VB program that call excel and manipulates workbooks and I use the following code to get excel open from VB. Dim xlapp As excel.Application Set xlapp = CreateObject("excel.application") However this always results in a new Excel instance and ignores any already open instances of excel. I would like an existing instance to be activated and if none exists, open a new one. Is this possible? Mahesh --- Message posted from http://www.ExcelForum.com/ |
activating excel from VB
Mahesh,
Try something like Dim XLApp As Excel.Application On Error Resume Next Set XLApp = GetObject(, "Excel.Application") If XLApp Is Nothing Then Set XLApp = CreateObject("Excel.Application") End If -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "mahesh " wrote in message ... Hello there, I'm running a VB program that call excel and manipulates workbooks and I use the following code to get excel open from VB. Dim xlapp As excel.Application Set xlapp = CreateObject("excel.application") However this always results in a new Excel instance and ignores any already open instances of excel. I would like an existing instance to be activated and if none exists, open a new one. Is this possible? Mahesh --- Message posted from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 09:01 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com