Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open en close a workbook with password

Hi,

I have a workbook with VBA code, that opens another workbook, collect
info from some cells and then closes the second workbook.

That works fine, but now i have a password for opening on the secon
workbook.

i can send this with my opening code, and then i don't get the passwor
input box. That's ok.
for example:
Workbooks.Open Filename:= "D:\test.xls", Password:="test"

But when the workbook is closed i always get the input box.

i can't find how i can send the password with the closing statement.

activeworkbook.close doesn't have a password property.
activeworkbook.saveas does, but then i get the question for overwrit
the workbook.

I don't want that eather.

I hope this is clear and someone has an answer or maybe a more easy wa
to do this.

greetz,
To

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Open en close a workbook with password

Tom,

could it be something recalculating in the second workbook
when you open it and the prompt being to save changes?

If so, this might help:

Activeworkbook.close savechanges:=false

If not, is there any way of getting the data out without
opening the workbook?

Pete
-----Original Message-----
Hi,

I have a workbook with VBA code, that opens another

workbook, collects
info from some cells and then closes the second workbook.

That works fine, but now i have a password for opening on

the second
workbook.

i can send this with my opening code, and then i don't

get the password
input box. That's ok.
for example:
Workbooks.Open Filename:= "D:\test.xls", Password:="test"

But when the workbook is closed i always get the input

box.

i can't find how i can send the password with the closing

statement.

activeworkbook.close doesn't have a password property.
activeworkbook.saveas does, but then i get the question

for overwrite
the workbook.

I don't want that eather.

I hope this is clear and someone has an answer or maybe a

more easy way
to do this.

greetz,
Tom


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
Macro to close workbook and re-open new copy Dave Lagergren Excel Discussion (Misc queries) 2 February 28th 07 10:11 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM
Open a password protected excel workbook from second workbook to fetch data using dynamic connection kaustav choudhury Excel Programming 2 April 3rd 04 06:18 AM
Close Open Workbook David Coleman Excel Programming 1 December 30th 03 05:53 PM
Close Open Workbook Bob Umlas[_3_] Excel Programming 1 December 30th 03 05:50 PM


All times are GMT +1. The time now is 04:11 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"