Excel VERY VERY strange behaviour!!!

pobo1234

New Member
Joined
Jan 26, 2017
Messages
12
I'm currently trying to migrate from Excel 2007 to 2013. I have a setup where one workbook (Scheduler.xlsm) calls a set of procedures in another (Core Workbook.xlsm) through automation which updates an MS Access database with dates from the Core Workbook using DAO. If I run the test in 2007 it closes all the workbooks as it should, however if I run the same test in 2013 it leaves a read only copy of the Core Workbook open.

I have not uploaded the project as I can't upload files but please PM/message me and I can send you the zipped folder. The test can be performed by clicking the "Run Test" button in Sheet1 of the Scheduler.xlsm workbook. All references are relative to the 2013 Migration folder and the test can be run using both 2007 and 2013.

Can anyone explain this difference in behaviour and suggest how to overcome it retaining the same or similar code please?

Many thanks

Pobo123
 
Thanks for your help Derek.

Both machines (2007 and 2013) are running on Windows 7 Enterprise. All of the references update automatically and correctly depending on which version is being run. The code runs perfectly without automation, it's just when automation is used that a problem appears with 2013.
It would be great to figure out what is going on but I may have to just use a work around.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I don't understand when you say that the code runs perfectly without automation. When not using VBA?
If you mean that it works OK when you step through the VBA code line by line, then it could be that the code is running "too fast" and called applications aren't being given a chance to close down tidily (e.g. release resources). If that is the case then perhaps inserting a line to "wait" for a second or two in the relevant place(s) may be the answer.
 
Upvote 0
No sorry Derek. I mean when you create an Excel object (appExcel) and use appExcel.application.run to run the procedure
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,315
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top