megatronixs
Registered User.
- Local time
- Today, 20:35
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
Today I have a voodoo day where all is hard to fix or find answer.
at the beginning I had only code to open one excel workbook and do something with it. Now because of new process, I have to do something more to it, so if the workbook is open, use it and don't open another.
I can't seem to find answer for this.
This below works, but when I need to run the second part via other button, it will open the workbook again and that one will be empty with not the values from previous code run:
Any idea to solve this? by the end of the day I seem not to get it.
Greetings.
Today I have a voodoo day where all is hard to fix or find answer.
at the beginning I had only code to open one excel workbook and do something with it. Now because of new process, I have to do something more to it, so if the workbook is open, use it and don't open another.
I can't seem to find answer for this.
This below works, but when I need to run the second part via other button, it will open the workbook again and that one will be empty with not the values from previous code run:
Code:
Set objXL = CreateObject("Excel.Application")
objXL.Visible = True
Set xlWB = objXL.Workbooks.Open("F:\Test\Downstream.xlsm")
Set xlWS = xlWB.Worksheets("process")
LastRow = xlWS.Cells(60000, 1).End(xlUp).Row
For j = 2 To LastRow
Acc = xlWS.Cells(j, 1).Value
Any idea to solve this? by the end of the day I seem not to get it.
Greetings.