Okay, I have code in an Access module that creates an Excel sheet, does some stuff and then quits. Long story short, it looks like this:
When I run it as visible, the Excel program opens, I see the spreadsheet being fiddled with, then I see the program close. However, in the System Process, I still have an EXCEL.EXE. The program is quite long so I can't paste the whole thing, but can anyone give me some tips about what to look for and what could be causing this?
Some more info. This only started to happen after I added these two lines of code, which are giving me an entirely different problem:
This code seems to work sometimes, and give an odd error other times ("The remote server machine does not exist or is unavailable")... When I comment it out, the program quits normally.
Am I doing something dumb? I couldn't find much documentation at all about FreezePanes around the Internet, so I just tried a few things until it worked... Like I said, it works sometimes, but seems to cause these other problems.
Any guidance would be appreciated.
Code:
Set xl = CreateObject("Excel.Application")
...some stuff...
xl.Quit
Set xl = Nothing
When I run it as visible, the Excel program opens, I see the spreadsheet being fiddled with, then I see the program close. However, in the System Process, I still have an EXCEL.EXE. The program is quite long so I can't paste the whole thing, but can anyone give me some tips about what to look for and what could be causing this?
Some more info. This only started to happen after I added these two lines of code, which are giving me an entirely different problem:
Code:
xlMainSheet.range("C2").Select
ActiveWindow.FreezePanes = True
This code seems to work sometimes, and give an odd error other times ("The remote server machine does not exist or is unavailable")... When I comment it out, the program quits normally.
Am I doing something dumb? I couldn't find much documentation at all about FreezePanes around the Internet, so I just tried a few things until it worked... Like I said, it works sometimes, but seems to cause these other problems.
Any guidance would be appreciated.