Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
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
I need a formula to determine when the data was last changed Climber of Mtns[_2_] Excel Discussion (Misc queries) 0 December 4th 09 09:51 PM
How to determine if a cell's data has been changed aidans Excel Discussion (Misc queries) 3 February 13th 07 03:47 PM
Determine whether a wrkbook have been changed since the last save Henk Frigge[_2_] Excel Programming 2 January 11th 06 10:21 PM
determine if a cell changed value Dave01 Excel Worksheet Functions 0 July 8th 05 04:49 PM
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? Daniel Excel Worksheet Functions 1 June 23rd 05 07:53 PM


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