Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Volatile Formula Issue Causing...

"Do you want to save the changes you made to€¦vbYesNoCancel"
during Access-to-Excel automation.

I'd read that can be prevented by...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

However, I'm using FollowHyperLink w/ the option
to open the Excel File...

In using..
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

...it doesn't allow the FollowHyperlink in code to open
the file..a "Gotcha"...how can I avoid the
"..want to save the changes you made.." MsgBox
and STILL open the file w/ FollowHyperlink???

TIA - Bob
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Volatile Formula Issue Causing...

Which workbook you want to close without saving? The one containing the macro
or the one which is opened through the hyperlink?

Thisworkbook refers to the workbook containing the macro...
Use ActiveWorkbook to refer to the workbook opened via the macro

Workbook_BeforeClose will be fired when the workbook with the macro is closed.

"Bob Barnes" wrote:

"Do you want to save the changes you made to€¦vbYesNoCancel"
during Access-to-Excel automation.

I'd read that can be prevented by...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

However, I'm using FollowHyperLink w/ the option
to open the Excel File...

In using..
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

..it doesn't allow the FollowHyperlink in code to open
the file..a "Gotcha"...how can I avoid the
"..want to save the changes you made.." MsgBox
and STILL open the file w/ FollowHyperlink???

TIA - Bob

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 134
Default Volatile Formula Issue Causing...

Within Access, I have..
Set objSavXLWb = objXLApp.ActiveWorkbook 'which is the "template"
objXLApp.ActiveWorkbook.SaveAs filename:=IPFile, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

"IPFile" is a string to save the selected Month & Year..IE.."ABC_Jan09.xls".
The FollowHyperlink opend the "IPFile" filename.

I need to save the "IPFile", and then, w/ a different reference to the
"ABC.xls" ("template"), close that.

... Workbook_BeforeClose AVOIDS the,,,
"Do you want to save the changes you made to€¦vbYesNoCancel"
but also prevents opening the "IPFile" (where the Volatile will run again).

Is that clear..if not, please let me know.
Thank you - Bob

"Bob Barnes" wrote:

during Access-to-Excel automation.




"Sheeloo" wrote:

Which workbook you want to close without saving? The one containing the macro
or the one which is opened through the hyperlink?

Thisworkbook refers to the workbook containing the macro...
Use ActiveWorkbook to refer to the workbook opened via the macro

Workbook_BeforeClose will be fired when the workbook with the macro is closed.

"Bob Barnes" wrote:

"Do you want to save the changes you made to€¦vbYesNoCancel"
during Access-to-Excel automation.

I'd read that can be prevented by...
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

However, I'm using FollowHyperLink w/ the option
to open the Excel File...

In using..
Private Sub Workbook_BeforeClose(Cancel As Boolean)
ThisWorkbook.Saved = True
End Sub

..it doesn't allow the FollowHyperlink in code to open
the file..a "Gotcha"...how can I avoid the
"..want to save the changes you made.." MsgBox
and STILL open the file w/ FollowHyperlink???

TIA - Bob

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
Formula Result = Volatile ?? monir Excel Discussion (Misc queries) 3 July 5th 08 01:17 AM
Text Causing a Problem in Formula Peter[_8_] Excel Discussion (Misc queries) 7 December 18th 07 12:05 PM
formula result=Volatile BCNU Excel Discussion (Misc queries) 2 January 5th 07 06:00 AM
VLOOKUP Formula causing an error japc90 Excel Discussion (Misc queries) 2 July 25th 06 11:36 PM
Formula Causing a Save Error Message Mr Mike Excel Worksheet Functions 2 September 1st 05 06:01 PM


All times are GMT +1. The time now is 07:35 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"