Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Saving a variable value

I have the following macro set to run when I open a workbook.

AutoSaveDetected = AddIns("Autosave Add-in").Installed

I use this to determine if a user has auto save installed. If they do, I
disable it and then enable it again in a BeforeClose procedure.

I have a problem in that if I disable auto save, I think the variable result
changes so that the value ends up as being always false when I run the
BeforeClose procedure and auto save never gets enabled.

Is there a way to have the variable store the value when the workbook is
opened instead of the current value?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Saving a variable value

Why not just disable it within the BeforeClose event as well. Put it in an
On Error Resume Next, and it won't matter if it is already disabled.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ed" wrote in message
...
I have the following macro set to run when I open a workbook.

AutoSaveDetected = AddIns("Autosave Add-in").Installed

I use this to determine if a user has auto save installed. If they do, I
disable it and then enable it again in a BeforeClose procedure.

I have a problem in that if I disable auto save, I think the variable

result
changes so that the value ends up as being always false when I run the
BeforeClose procedure and auto save never gets enabled.

Is there a way to have the variable store the value when the workbook is
opened instead of the current value?



  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Saving a variable value

Hi Bob,

I'm just starting out with VBA.

Could you explain what this procedure does?

thanks

"Bob Phillips" wrote:

Why not just disable it within the BeforeClose event as well. Put it in an
On Error Resume Next, and it won't matter if it is already disabled.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ed" wrote in message
...
I have the following macro set to run when I open a workbook.

AutoSaveDetected = AddIns("Autosave Add-in").Installed

I use this to determine if a user has auto save installed. If they do, I
disable it and then enable it again in a BeforeClose procedure.

I have a problem in that if I disable auto save, I think the variable

result
changes so that the value ends up as being always false when I run the
BeforeClose procedure and auto save never gets enabled.

Is there a way to have the variable store the value when the workbook is
opened instead of the current value?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Saving a variable value

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
'your code to disable the addin
On Error GoTo 0

'your code to enable it
End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ed" wrote in message
...
Hi Bob,

I'm just starting out with VBA.

Could you explain what this procedure does?

thanks

"Bob Phillips" wrote:

Why not just disable it within the BeforeClose event as well. Put it in

an
On Error Resume Next, and it won't matter if it is already disabled.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"ed" wrote in message
...
I have the following macro set to run when I open a workbook.

AutoSaveDetected = AddIns("Autosave Add-in").Installed

I use this to determine if a user has auto save installed. If they

do, I
disable it and then enable it again in a BeforeClose procedure.

I have a problem in that if I disable auto save, I think the variable

result
changes so that the value ends up as being always false when I run the
BeforeClose procedure and auto save never gets enabled.

Is there a way to have the variable store the value when the workbook

is
opened instead of the current value?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving as variable file name leerem Excel Discussion (Misc queries) 1 September 29th 08 10:30 AM
Saving a workbook with a variable name mwc0914[_5_] Excel Programming 2 July 26th 05 06:18 PM
Saving a workbook with a variable name mwc0914[_4_] Excel Programming 1 July 26th 05 04:44 PM
Saving Workbook with Variable JJ Excel Programming 2 December 2nd 04 10:44 PM
Saving Registry variable to ini file Allen[_3_] Excel Programming 0 September 10th 03 06:14 PM


All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"