Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Set EnableAutoRecover to False

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kent - 25 Jan 2008 02:22 GMT
I have an Excel application that is used by manys users with Excel
versions varying from Excel 2000 to Excel 2007. WIth the release of
Excel 2007, you must Digitally sign the project to enable macros.
However, Microsoft has a known bug that results in the users being
unable to save the file at times. The bug is a combination of
Autorecover and the digital signature. Microsoft's solution is to
disable autorecover.  That can be done using:

ActiveWorkbook.EnableAutoRecover = False

However, since autorecovery was not available in Excel 2000, the
workbook has a compilaion error. I tried using conditinal compilation,
but I could not figure out how to use the Excel version in the
conditional compilation. I also thought I may be able to use
CallByName to solve this, but I couldn't figure out how to use that
with the ActiveWorkbook.EnableAutoRecover statement.

Any help will be MUCH appreciated.
Dave Peterson - 25 Jan 2008 03:09 GMT
I'd create a new module with a single sub in it:

Option Explicit
Sub OnlyThisSub()
  ActiveWorkbook.EnableAutoRecover = False
end Sub

Then in any other module, you can use:

if val(application.version) < 10 then
   call OnlyThisSub
end if

The code in that separate module won't be run or even compiled.

(xl2002 is version 10, right???)

(and change the name to something nice <vbg>)

> I have an Excel application that is used by manys users with Excel
> versions varying from Excel 2000 to Excel 2007. WIth the release of
[quoted text clipped - 14 lines]
>
> Any help will be MUCH appreciated.

Signature

Dave Peterson

Kent - 25 Jan 2008 15:32 GMT
> I'd create a new module with a single sub in it:
>
[quoted text clipped - 39 lines]
>
> - Show quoted text -

Thank you VERY much Dave. I did not realize that it would not try to
compile a module unless the code within it  was to be executed.
Obvious I guess. Your response is a great solution. Tank you again.
You have saved me a lot of grief!

Kent
Dave Peterson - 25 Jan 2008 15:59 GMT
First, I had my test backwards!

if val(application.version) >= 10 then
   call OnlyThisSub
end if
(but you probably caught that!)

I don't have xl2k to test, but you could try this, too:

Dim myApp as Object 'generic object
...
if val(application.version) >= 10 then
 set myApp = Application
 myapp.activeworkbook.enableautorecover = false
end if

> > I'd create a new module with a single sub in it:
> >
[quoted text clipped - 46 lines]
>
> Kent

Signature

Dave Peterson

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.