Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Openning a file using the password from VBA

Is there a way, given a file's path & name, to determine if it is a password
protected Excel workbook?

And, if it is a password protected workbook, can I open it from VBA using
that password, so I can modify it and save it from VBA?

Thanks,
Ken


  #2   Report Post  
Posted to microsoft.public.excel.programming
moi moi is offline
external usenet poster
 
Posts: 27
Default Openning a file using the password from VBA

Sub OpenProtectedFile()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = Workbooks.Open("C:\Password Protected File.xls", , , ,
"password1", "password2")
Set ws = wb.Sheets("Sheet1")
ws.Activate
ws.Cells(1, 1).Value = "Modified by VBA"
End Sub

"Ken Loomis" schreef in bericht
...
Is there a way, given a file's path & name, to determine if it is a
password protected Excel workbook?

And, if it is a password protected workbook, can I open it from VBA using
that password, so I can modify it and save it from VBA?

Thanks,
Ken




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
how do I set up the openning type of file Alberto Sanchez Excel Discussion (Misc queries) 0 July 7th 09 04:26 PM
Openning spesific file in Excel Farhad Excel Discussion (Misc queries) 1 November 29th 07 02:11 PM
how to turn off highlighted cells when openning an excell file Alexandra Excel Discussion (Misc queries) 0 August 31st 07 11:56 AM
Openning an .csv file hbarniv Excel Discussion (Misc queries) 4 December 1st 04 12:29 AM
Getting dw20.exe error while openning excel formatted xml file Anjan Excel Programming 0 October 4th 04 02:21 PM


All times are GMT +1. The time now is 05:32 PM.

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"