Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Determine if the sheet has been changed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erik Wikström - 12 Dec 2007 10:33 GMT
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.

Signature

Erik Wikström

Mike H - 12 Dec 2007 12:20 GMT
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

> 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
[quoted text clipped - 9 lines]
> 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 - 12 Dec 2007 15:00 GMT
> > 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
[quoted text clipped - 22 lines]
> ActiveWorkbook.Saved = True
> Should generate a prompt to save changes when closing.

Hmm, that might work. Thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.