I found http://www.vbforums.com/showthread.p...6-(or-VB5-VBA) very useful. But It did not cover one thing I need.
If I open a workbook and worksheet using this code:
then I can edit it and do whatever I want with it. But if I already have an opened worksheet, lets say by another program, how can I edit it, without saving and closing and opening it again?
As far as I understand when user or another program opens excel it creates a connection, so is it possible to use that connection to work with already opened worksheet ? (this only my assumption, I don't know if it works this way).
I hope I made my question clear. Thanks
If I open a workbook and worksheet using this code:
HTML Code:
Dim oXLApp as Excel.Application 'Declare the object variables
Dim oXLBook as Excel.Workbook
Dim oXLSheet as Excel.Worksheet
oXLApp = New Excel.Application 'Create a new instance of Excel
oXLBook = oXLApp.Workbooks.Open("C:\Users\****\Desktop\Test.xls")
oXLSheet = oXLBook.Worksheets(1) 'Work with the first worksheet
As far as I understand when user or another program opens excel it creates a connection, so is it possible to use that connection to work with already opened worksheet ? (this only my assumption, I don't know if it works this way).
I hope I made my question clear. Thanks