LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Save sheet when cell value changes

Cam.,

Haven't tried this as I don't have IIS and ASP on this machine, but this
worksheet event code will force a save when a cell changes, but what I don't
know is if your web update will force this event.

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
ThisWorkbook.Save

ws_exit:
Application.EnableEvents = True
End Sub


If you want to only do the updates on changes to certain cells, try this mod
for example
Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False
On Error GoTo ws_exit
If Not Intersect(Target, Range("A1:M100")) Is Nothing Then
ThisWorkbook.Save
End If

ws_exit:
Application.EnableEvents = True
End Sub


What worries me is what happens if the web update flods the page with
changes? Each cell change will trigger a workbook save, and what happens to
the outstanding updates. Anyway, try it and see.

--

HTH

Bob Phillips

"Cam" wrote in message
...
OK, I have a workbook with several sheets, one sheet takes
input from a .asp web page and updates other sheets based
on the values. I DESPERATELY need to save the workbook
evertime a cell value changes (from the .asp web page
input) as currenlty the update occurs but will not save
before the next entry is made from the .asp page. THANKS



 
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
a Macro to "save as" filename from a cell on the sheet and then pr gugertmk Excel Discussion (Misc queries) 0 March 31st 09 12:32 AM
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
How to save only row changes to a new sheet J Sears Excel Discussion (Misc queries) 1 September 22nd 06 07:50 PM
save as w/sheet TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 September 16th 06 08:05 PM
Save sheet? Heine Excel Worksheet Functions 7 March 9th 05 10:55 AM


All times are GMT +1. The time now is 02:32 AM.

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"