Hi,
I am new to the forum and was hoping someone could help me out with my first query.
I have an excel spreadsheet with a number of querytables in it.
I have written a service in Visual basic which will open the spreadsheet in the early hours of each morning, cycle through each querytable and refresh it and then save off a copy of the spreadsheet containing the updated info.
However, when the service executes I get the error 1004 - Application-defined or object-defined error at the line "qt.refresh" (qt being a variable defined as an Excel.QueryTable).
I have created a separate application that runs as a normal application to test the code and it all works fine when logged in as the user in question. It just doesn't want to play ball when being run as a service when the user is not logged in.
I found some posts online that suggested removing the "BackgroundQuery:=False", but it still comes up with the same error.
Do I need to perhaps reference the querytables in a different way? Any help would be appreciated.
Thanks.
Bookmarks