#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving data


Hi,

I have spreadsheet to which users are adding data via UserForms. I
would like to save the data as the user is entering it and to remove
the 'Do you want to save changes' message box that appears when the
user closes down excel.

Any idears

Regards

Bach


--
bach
------------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=473685

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Saving data

Hi Bach,

Use the .Saved workbook property.

Application.ActiveWorkbook.Save
Application.ActiveWorkbook.Saved = True

Best regards

John

"bach" wrote in message
...

Hi,

I have spreadsheet to which users are adding data via UserForms. I
would like to save the data as the user is entering it and to remove
the 'Do you want to save changes' message box that appears when the
user closes down excel.

Any idears

Regards

Bach


--
bach
------------------------------------------------------------------------
bach's Profile:
http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=473685



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving data


I have included, this code inside a private sub when the user enteres
the data into the spreadsheet i have saved it.

This does not stop the message appearing to save changes when closing
the workbook, this is because of the fact that the save code is inside
a private sub ??


--
bach
------------------------------------------------------------------------
bach's Profile: http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=473685

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 205
Default Saving data

Hello Bach,

No, being in a Private sub shouldn't make any difference.

Are you sure that this part of the code is actually being executed? Maybe
step through it line by line (using F8 key) to check that this is happening.

Another other thing is have you changed the code to reference the correct
Workbook? The code below would be fine if only one workbook is open, but is
it possible the user has two workbooks open? Begin the procedure by setting
a reference to the correct workbook:

Dim myWkb As Workbook

Set myWkb = Application.ActiveWorkbook
'Your code here
myWkb.Save
myWkb.Saved = True

A final possibility is that something else is being changed in between the
workbook Saved property being set to true and the workbook actually closing.
If this is the case then the property will be reset to False and you'll be
asked if you want to save.

Hope that helps.

Best regards

John

Application.ActiveWorkbook.Save
Application.ActiveWorkbook.Saved = True


"bach" wrote in message
...

I have included, this code inside a private sub when the user enteres
the data into the spreadsheet i have saved it.

This does not stop the message appearing to save changes when closing
the workbook, this is because of the fact that the save code is inside
a private sub ??


--
bach
------------------------------------------------------------------------
bach's Profile:
http://www.excelforum.com/member.php...o&userid=26134
View this thread: http://www.excelforum.com/showthread...hreadid=473685



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 data? Rhea Excel Discussion (Misc queries) 3 July 22nd 09 02:36 PM
Saving Data puppynanee Excel Discussion (Misc queries) 0 March 29th 06 09:32 PM
Saving worksheet as CSV after pulling data from an external data source Richard Edwards[_3_] Excel Programming 4 February 25th 05 09:08 PM
Saving data legepe[_3_] Excel Programming 0 October 20th 04 12:34 AM
Saving data in an add-in Stewart Walker Excel Programming 1 April 27th 04 09:41 AM


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