+ Reply to Thread
Results 1 to 2 of 2

Correcting a cell formula via a patch

  1. #1
    Rick K
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <RickK@discussions.microsoft.com> wrote in message
    news:E61F714B-17B8-4CDB-8E5F-715AEA99A715@microsoft.com...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1