Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Facing Error - Automation error Exception occurred

0

Hello Experts,

I am facing Error of "Automation error Exception occurred" at Start of real time updates activated in the attached sheet, but when If the excel sheet is opened after the start of the real time updates, it is working fine.

Hence, I am looking for solution for the same.

Therefore, Can I request you for your expert knowledged based solution.

I would really appreciate your response for the said subject.

Attached sheet for your ready reference.

Regards,

Answer
Discuss

Discussion

Sunil. Suggest you don't start your questions with "Hello Experts" - which my discourage answers from people who don't consider themselves to be experts (and I don't) - and using fawning language. You may be sincere but it's off-putting to me at least.
John_Ru (rep: 6152) Sep 21, '21 at 4:14 am
Add to Discussion

Answers

0
Selected Answer

Sunil

I had a failure on opening (it's before your StartTime here) but not your automation error.

I changed the macro title Private Sub MyMacro() to Sub MyMacro(), saved and it re-opened okay.

The macros failed initially (owing to the filename changing in my Download folder) so I changed this line in MyMacro:

With Workbooks("Macro Copy paste and Cut paste Testing 1.xlsm").Worksheets("Sheet1") ' Change name to suit
to:
With ThisWorkbook.Worksheets("Sheet1") ' Change name to suit

and similar for MyATR, myclearmacro etc.Now if you change the file name, it will still work.

I noticed that you still had very low time intervals for run macros (10 or 20 seconds) so set them all to TimeValue("00:05:00") i.e. 5 minutes. Seems to be running okay but I leave you to check in revised file.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login