GetObject

M

Michael

How can I use GetObject to open an Excel file that has
password protection without getting the Excel dialog popup
(I have the password and can supply it but GetObject
doesn't appear to accept any paramaters other than the
file name)
 
T

Tom Ogilvy

if you are using Excel VBA, use

Workbooks.open Filename:="C:\Myfile.xls", Password:="ABCD"

You don't need to use GetObject and that would be the long way to do it.
 
G

Guest

I'm using VB script (not VBA) to manipulate the excel
file, that is why I need the GetObject procedure
 
T

Tom Ogilvy

use GetObject to start an instance of Excel. Assume you return the
reference to xlapp

set xlWkBk = xlApp.Workbooks.open( Filename:="C:\Myfile.xls",
Password:="ABCD")
 
Top