Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
R A R A is offline
external usenet poster
 
Posts: 3
Default Force no save on workbook exit

Hello

I have the following macro code performing a bit of a dance with sheets
in a workbook, and doing some date validation along the way. The code
works fine, however what I thought was supposed to be working is the
command to disable excel asking the user if they want to save:
----------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Application.Sheets("Sheet1").Select
Call Hide_Error
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.Quit
Else: Application.Quit
End If
End If
Me.Saved = True
End Sub
----------------------------------------------------------

Doesn't 'Me.Saved = True' do this?
Basically I want stop excel putting up a dialogue asking the user do
they want to save. Any suggestions on how I may be able to do this?

Thankyou.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Force no save on workbook exit

Hi
application.displayalerts=false

--
Regards
Frank Kabel
Frankfurt, Germany
"R A" schrieb im Newsbeitrag
...
Hello

I have the following macro code performing a bit of a dance with sheets
in a workbook, and doing some date validation along the way. The code
works fine, however what I thought was supposed to be working is the
command to disable excel asking the user if they want to save:
----------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Application.Sheets("Sheet1").Select
Call Hide_Error
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.Quit
Else: Application.Quit
End If
End If
Me.Saved = True
End Sub
----------------------------------------------------------

Doesn't 'Me.Saved = True' do this?
Basically I want stop excel putting up a dialogue asking the user do
they want to save. Any suggestions on how I may be able to do this?

Thankyou.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Force no save on workbook exit

Thisworkbook.Saved=True will also work.

"Frank Kabel" wrote:

Hi
application.displayalerts=false

--
Regards
Frank Kabel
Frankfurt, Germany
"R A" schrieb im Newsbeitrag
...
Hello

I have the following macro code performing a bit of a dance with sheets
in a workbook, and doing some date validation along the way. The code
works fine, however what I thought was supposed to be working is the
command to disable excel asking the user if they want to save:
----------------------------------------------------------
Sub workbook_open()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Visible = xlSheetVisible
Next ws
Application.Sheets("Sheet1").Select
Call Hide_Error
If Now = Worksheets("Error").Range("AO241") Then
Confirm = MsgBox("This workbook has expired. Please contact support
for further assistance.", vbInformation + vbOKOnly, "Workbook Expiry")
If Confirm = vbOKOnly Then
Application.Quit
Else: Application.Quit
End If
End If
Me.Saved = True
End Sub
----------------------------------------------------------

Doesn't 'Me.Saved = True' do this?
Basically I want stop excel putting up a dialogue asking the user do
they want to save. Any suggestions on how I may be able to do this?

Thankyou.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!




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
Force sort before worksheet exit Kathrine Excel Worksheet Functions 2 April 4th 07 08:30 AM
Force a Readonly Workbook to save to a different folder Charlotte Howard Excel Discussion (Misc queries) 6 August 23rd 06 04:41 PM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM
Save & Exit Anthony Excel Worksheet Functions 1 February 12th 05 05:23 PM
auto save on exit while at the same time rename workbook... Brian Excel Programming 2 October 5th 04 01:33 AM


All times are GMT +1. The time now is 10:25 PM.

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

About Us

"It's about Microsoft Excel"