Open en close a workbook with password

  • Thread starter Thread starter Morrigu
  • Start date Start date
M

Morrigu

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
 
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
 

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