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: 2
Default How to Cancel the Protect of Excel with VB and save it with a new password again

I need to Open an Excel file with protection password and save it with a new
password again after changing the Excel.

Now I know only:

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet


Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("D:\aa.xls", , , , 123)

x1Book.Unprotect ("123")
Set xlsheet = xlBook.Worksheets(1)
xlsheet.Cells(1, 1) = abc

xlBook.Close (True)
xlApp.Quit

But x1Book.Unprotect ("123") is error.
And I don't know how to cancel the protect of Excel with VB ;and I don't
know how to save it with a new password again after changing the Excel.


Any help would be most appreciated.

Torch Nee



 
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
Password Protect so can't save and change Brandy Excel Discussion (Misc queries) 1 September 4th 08 12:39 AM
trying to save a document, I get inaccessible or password protect Curlygirl Excel Discussion (Misc queries) 1 May 30th 07 07:52 PM
Cancel 'Password' prompt during VBA Shimmess Excel Programming 7 December 28th 06 03:50 AM
Password redundant through use of cancel Blokeyfella Excel Discussion (Misc queries) 1 February 1st 06 05:00 PM
Cancel Macro is user selects 'cancel' at save menu Mark Excel Programming 1 April 6th 05 05:45 PM


All times are GMT +1. The time now is 04:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"