AutoSaveOn issue with Excel 2013 and 2016

ThomasFoster

New Member
Joined
Jul 18, 2019
Messages
1
Sorry if this is in the wrong location, this is the first time I am posting on this forum.

My issue is a regarding a "Compile Error: Method or data member not found" that happens when an excel file is opened by some users. These users have either excel 2013 or 2016 installed.

The compile error is related to the "ThisWorkbook.AutoSaveOn" command in the below code that runs in the WorkBook_Open() Sub.
Code:
If Val(Application.Version) > 15 Then        If ThisWorkbook.AutoSaveOn Then ThisWorkbook.AutoSaveOn = False
    End If

I have googled this issue and found references to this not working well with Excel 2013 but nothing regarding issues with Excel 2016.
It is also not even going to my error handler function it is failing right away.

I am at a bit of a loss as to how to fix this in such a way that lets the file work on Excel 2013/2016 and yet still disables the autosave when running in later versions where the code works no problem.

Is this something that can be fixed or do I need to rip out this section for it to work on older versions.

Thanks for your help.
 
Yup. If you needed confirmation that MS really doesn’t care much about VBA anymore, there you have it. Simple conditional compilation constants for each version would have been a great start and not that hard to do!
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Yup. If you needed confirmation that MS really doesn’t care much about VBA anymore, there you have it. Simple conditional compilation constants for each version would have been a great start and not that hard to do!
Indeed, if it's a viable option to allow use of If #VBA7 Then, I don't see why they couldn't do the same for #XL2016, #XL2019 or #XL365...
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,588
Members
449,174
Latest member
chandan4057

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