Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if the sheet has been changed
I have a workbook where on one sheet the user can use a set of buttons and
dialogues to add new column headers to a table and then fill in the correct default values for each row in that column. The headers shown are stored in an internal datastructure and to ease insertion of new headers (which might be inserted in the middle of the table) I have written code that first clears all headers and then re-draws them whenever the user adds new headers. This code is also run when the user opens the workbook. The problem with this is that Excel counts this re-drawing (even if no change is made) as changing the workbook, so if I just open the book and then try to close it Excel asks if I want to save since the book has been changed. So I wonder if it is possible to tell Excel to ignore changed to certain rows when determining if the workbook has been changed. -- Erik Wikström |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if the sheet has been changed
Hi,
You could do this:- Private Sub Workbook_Open() 'Make your changes to headers etc ActiveWorkbook.Saved = True End Sub Only changes made after the line ActiveWorkbook.Saved = True Should generate a prompt to save changes when closing. Mike "Erik Wikström" wrote: I have a workbook where on one sheet the user can use a set of buttons and dialogues to add new column headers to a table and then fill in the correct default values for each row in that column. The headers shown are stored in an internal datastructure and to ease insertion of new headers (which might be inserted in the middle of the table) I have written code that first clears all headers and then re-draws them whenever the user adds new headers. This code is also run when the user opens the workbook. The problem with this is that Excel counts this re-drawing (even if no change is made) as changing the workbook, so if I just open the book and then try to close it Excel asks if I want to save since the book has been changed. So I wonder if it is possible to tell Excel to ignore changed to certain rows when determining if the workbook has been changed. -- Erik Wikström |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine if the sheet has been changed
"Mike H" wrote:
"Erik Wikström" wrote: I have a workbook where on one sheet the user can use a set of buttons and dialogues to add new column headers to a table and then fill in the correct default values for each row in that column. The headers shown are stored in an internal datastructure and to ease insertion of new headers (which might be inserted in the middle of the table) I have written code that first clears all headers and then re-draws them whenever the user adds new headers. This code is also run when the user opens the workbook. The problem with this is that Excel counts this re-drawing (even if no change is made) as changing the workbook, so if I just open the book and then try to close it Excel asks if I want to save since the book has been changed. So I wonder if it is possible to tell Excel to ignore changed to certain rows when determining if the workbook has been changed. Hi, You could do this:- Private Sub Workbook_Open() 'Make your changes to headers etc ActiveWorkbook.Saved = True End Sub Only changes made after the line ActiveWorkbook.Saved = True Should generate a prompt to save changes when closing. Hmm, that might work. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I need a formula to determine when the data was last changed | Excel Discussion (Misc queries) | |||
How to determine if a cell's data has been changed | Excel Discussion (Misc queries) | |||
Determine whether a wrkbook have been changed since the last save | Excel Programming | |||
determine if a cell changed value | Excel Worksheet Functions | |||
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? | Excel Worksheet Functions |