ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Referencing password protected Workbook (https://www.excelbanter.com/excel-programming/304629-referencing-password-protected-workbook.html)

Viggy[_3_]

Referencing password protected Workbook
 
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

--
Message posted from http://www.ExcelForum.com


Rob Bovey

Referencing password protected Workbook
 
"Viggy " wrote in message
...
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 *




Frank Kabel

Referencing password protected Workbook
 
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

--
Regards
Frank Kabel
Frankfurt, Germany

"Viggy " schrieb im Newsbeitrag
...
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...
THe problem has been that no matter what I try, B opens up, and asks
for the password... Is there anyway to reference the method in B
without B opening up, given that B is password protected?

Thanks,
Viggy


---
Message posted from http://www.ExcelForum.com/



Viggy[_4_]

Referencing password protected Workbook
 
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

--
Message posted from http://www.ExcelForum.com


Rob Bovey

Referencing password protected Workbook
 
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 *


"Viggy " wrote in message
...



Frank Kabel

Referencing password protected Workbook
 
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

--
Regards
Frank Kabel
Frankfurt, Germany

"Viggy " schrieb im Newsbeitrag
...
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 see
that its open?


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 12:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com