CPGDeveloper
Board Regular
- Joined
- Oct 8, 2008
- Messages
- 189
Hello~
This is driving me insane. Any help would be greatly appreciated.
I have an MS Access Application that runs a relatively complex process of extracting data from certain Excel workbooks, performing several calculations, and then populating the results of the calculations in another workbook. It loops through 20 times to do this for 20 sets of data.
Often the code works perfectly -- from beginning to end without issue. Sometimes, it will hang on a particular line...no error, it just hangs -- line of code is this:
Set dwk = dxl.Workbooks.Open(cfile)
dwk being defined as an Excel workbook, and dxl as an instance of excel that is already open. cfile is the full path and name of the workbook.
What is so mysterious is how inconsistent this is -- sometimes it works, sometimes it doesn't. I'm working on this on a Saturday -- there is nobody in these workbooks or using these workbooks.
I tried to close and re-open that instance of excel before I execute this code, thinking that might somehow prevent this, but it did not seem to make a difference.
I also thought that some of the workbooks have links within them, and a pop-up appears every time when one opens those workbooks about updating links -- and that perhaps this was causing issues. But if that was an issue, I don't understand why it wouldn't happen every time.
I've searched this forum and others for folks experiencing similar issues -- there are a few posts here or there, but nothing seems to account for this. I'm at a loss. Again, any help would be greatly appreciated. Thanks.
This is driving me insane. Any help would be greatly appreciated.
I have an MS Access Application that runs a relatively complex process of extracting data from certain Excel workbooks, performing several calculations, and then populating the results of the calculations in another workbook. It loops through 20 times to do this for 20 sets of data.
Often the code works perfectly -- from beginning to end without issue. Sometimes, it will hang on a particular line...no error, it just hangs -- line of code is this:
Set dwk = dxl.Workbooks.Open(cfile)
dwk being defined as an Excel workbook, and dxl as an instance of excel that is already open. cfile is the full path and name of the workbook.
What is so mysterious is how inconsistent this is -- sometimes it works, sometimes it doesn't. I'm working on this on a Saturday -- there is nobody in these workbooks or using these workbooks.
I tried to close and re-open that instance of excel before I execute this code, thinking that might somehow prevent this, but it did not seem to make a difference.
I also thought that some of the workbooks have links within them, and a pop-up appears every time when one opens those workbooks about updating links -- and that perhaps this was causing issues. But if that was an issue, I don't understand why it wouldn't happen every time.
I've searched this forum and others for folks experiencing similar issues -- there are a few posts here or there, but nothing seems to account for this. I'm at a loss. Again, any help would be greatly appreciated. Thanks.