Hello,
I'm trying to automate some reporting that I do for my company and I've created a process with a combination of recorded macros and published code.
The process begins with a workbook open event that calls each of the sub procedures. Basically the old range/table is deleted and then a new ODBC connection to an Access database that contains a pass through query to my companies data warehouse which returns a set of data to a new query table in excel and then sends an email and closes.
Sometimes, with one of these processes in particular I get the "Get Run-time error '1004' General ODBC Error" when the code gets to the line ".Refresh BackgroundQuery:=False" in my ConnectDB sub.
Here is the code:
I recorded the ConnectDB sub and so I have a feeling that's where the issue is but I'm not sure.
Does anyone know what I may be doing wrong here?
Thank you for your help!
Bookmarks