Well the thing is, that I have this button that runs through an Excel sheet, to get info and list it in a combobox. When users presses a button, I need to get more info from Excel, so I dont wanna close excel when I added the stuff in the combobox, so to ensure that the program was only closed when I KNOW that I am done with the Excel sheet.
So I got this idea to close it when my form closes. But the only way I can do objXL.quit is when objXL exists (which is logically correct enough). So I need to check if ObjXL is not Nothing before I do: objXL.quit
I got it...The problem was that I was dimentioning the objXL varible in a button key-press procedure. And it is therefore not dimentioned in other procedures. What I did was make a global objXL variable. And that fixed the problem.
But it was still your solution that did it Terry, and thus you get points. Thank you...
Yes if your using it globally then it has to be declared as a global variable
Thanks
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.