Referencing password protected Workbook

  • Thread starter Thread starter Viggy
  • Start date Start date
V

Viggy

I have workbook A and Workbook B, both of which have a password on th
workbook and on read-only password...

While running A, I need to call a sub within B, without B being open..
THe problem has been that no matter what I try, B opens up, and ask
for the password... Is there anyway to reference the method in
without B opening up, given that B is password protected?

Thanks,
Vigg
 
Viggy > said:
I have workbook A and Workbook B, both of which have a password on the
workbook and on read-only password...

While running A, I need to call a sub within B, without B being open...

Hi Viggy,

Unfortunately, there is no way to do this. You must open a workbook in
order to call any code that it contains.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
Hi
for referencing a method you HAVE to open the other workbook. One way
would be to use
workbooks.open
together with the password of this file
 
Whats the syntax for opening the file with the password?

(i'm assuming something along the lines of :
Open.file password:= "stuff")

Also, is there a way to open the file, such that the user can't se
that its open
 
Whats the syntax for opening the file with the password?

Workbooks("MyBook.xls").Open password:="MyPassword"
Also, is there a way to open the file, such that the user can't see
that its open?

The easiest way is to save it as a hidden workbook. Choose Window/Hide
from the Excel menu and save it that way from the Visual Basic Editor.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


news:[email protected]...
 
Hi
just look at the Excel VBA help :-)

e.g.
Sub foo()
Application.ScreenUpdating = False
Workbooks.Open Filename:="D:\temp\test.xls",
WriteResPassword:="your_password"
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top