running excel using a windows service

May 13 2004 10:28 AM
I have created a c# windows service (sort of like a customized scheduler) that I would like to use to run various applications - mostly written in VB6. I have a VB6 app that creates excel spreadsheets, and one of the things I do is prepare the spreadsheet for printing by setting margins, etc. Running the standalone VB app works fine. Even running the VB app thru a C# console program works fine. The windows service calls the VB app and creates the spreadsheet , but for some reason the VB app writes an error to a log - "Unable to set the PrintTitleRows property of the PageSetup class". And on opening the xls I can see the formatting has not been done. Now, this error can occur if a printer has not been set up, but I have a printer. Basically, the print formatting I try to do, doesn't get done. Any ideas? Thanks