Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Correcting a cell formula via a patch

I have a sales forecasting spreadsheet that has been distrubited to our sales
force. An error was found in one cell that requires a fix, but, the workbook
is passworded, the page the error is in is protected with password and the
column the cell is in is hidden. I was wondering if it is possible to create
a patch to correct this simple error via vb or vba. To call all of these
sheets back would be too time consuming and to allow the sales people access
to passwording and page protection would be too dangerious.
Any thoughs on this
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Correcting a cell formula via a patch

It would go something like this.
Dim sName as String, bk as workbook
sName = "C:\Myfolder\MyFile.xls"
set bk = Workbooks.Open(FileName:=sName, password:="SecretPassword")
bk.Worksheets(1).UnProtect Password:="ABCD"
bk.worksheets(1).Formula = "=Sum(A1:B9)"
bk.Worksheets(1).Protect Password:="ABCD"
bk.Close SaveChanges:=True

You could add code to prompt the user to use the mouse to find the file

sName = Application.GetOpenfileName()

Obiously you would want this code in a workbook where the code is protected

You don't need to unhide the column to update the cell.

Add other error handling as appropriate.
--
Regards,
Tom Ogilvy


"Rick K" wrote in message
...
I have a sales forecasting spreadsheet that has been distrubited to our

sales
force. An error was found in one cell that requires a fix, but, the

workbook
is passworded, the page the error is in is protected with password and the
column the cell is in is hidden. I was wondering if it is possible to

create
a patch to correct this simple error via vb or vba. To call all of these
sheets back would be too time consuming and to allow the sales people

access
to passwording and page protection would be too dangerious.
Any thoughs on this
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
Help with correcting writing a formula tuk16664 Excel Worksheet Functions 5 February 6th 07 01:13 PM
HSI in data cell is auto correcting to HIS C Brandt Excel Discussion (Misc queries) 1 April 25th 06 11:08 PM
CORRECTING ERROR IN A SUM FORMULA BBGSIS Excel Discussion (Misc queries) 2 March 6th 06 12:49 AM
correcting a negative date formula woodlot4 Excel Discussion (Misc queries) 6 November 6th 05 10:05 AM
need help in correcting the formula azmi Excel Worksheet Functions 1 June 11th 05 08:36 PM


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