Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
saving data? | Excel Discussion (Misc queries) | |||
Saving Data | Excel Discussion (Misc queries) | |||
Saving worksheet as CSV after pulling data from an external data source | Excel Programming | |||
Saving data | Excel Programming | |||
Saving data in an add-in | Excel Programming |