Internally we use a proprietary excel built project management solution. Essentially, the system operates by generating a number of workbooks for the purposes of tracking individual projects. All of these workbooks are created and updated by a master workbook, which needs to load the child workbooks into the same excel application in order to update data on the worksheets.
We have recently altered the system to configure an ODBC datasource to replace the older less performant mechanism of writing exported data into a sheet in the master workbook and then copying the sheets to other workbooks. However, in doing this it caused a previously working vba macro that calls Workbooks.Open to fail with the error 1004.
I have created a test case of writing a vba macro that only calls Workbooks.Open with one of these child workbooks and it still causes the error. Replacing the call with a ShellExecute call that would launch a new excel instance with the specified workbook succeeds and opens the workbook as expected.
My only idea is that perhaps the load operation fails because the security restrictions placed on what I can only assume is an OLE connection to the excel application from the vba host prevents the loaded workbook from establishing a new database connection, but I'm rather at a loss to of how to proceed further.
Any advice would be greatly appreciated.
TIA,
Oliver Taylor
(Edit: Using Excel 2013)