Hi all,
I have a problem that seems to be fairly common around the place ive noticed, after doing some googling.
It seems cell references made in an Access module need to be hung off the excel.application object, and if they are not the code runs and then hangs without the user knowing. But you can still see the excel process in task manager.
Ok, so the solution would be to hang all your range references off the excel.application object right?
No so... 2 examples are as follows. They both set the value of "A1" to 20
1. objXL.Range("A1").value = 20
2. objXL.Range(Cells(1, 1), Cells(1, 1)).value = 20
both lines of code are correct except that a procedure with the 2nd line will hang and the excel instance remains open in the processes.
How can I keep the flexibility of the2nd method of cell referencing but ensure that the process is properly ended?
What is the correct way to create a hidden instance of excel in automation?
I have a problem that seems to be fairly common around the place ive noticed, after doing some googling.
It seems cell references made in an Access module need to be hung off the excel.application object, and if they are not the code runs and then hangs without the user knowing. But you can still see the excel process in task manager.
Ok, so the solution would be to hang all your range references off the excel.application object right?
No so... 2 examples are as follows. They both set the value of "A1" to 20
1. objXL.Range("A1").value = 20
2. objXL.Range(Cells(1, 1), Cells(1, 1)).value = 20
both lines of code are correct except that a procedure with the 2nd line will hang and the excel instance remains open in the processes.
How can I keep the flexibility of the2nd method of cell referencing but ensure that the process is properly ended?
What is the correct way to create a hidden instance of excel in automation?