Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to close workbook and re-open new copy | Excel Discussion (Misc queries) | |||
How can I close only 1 workbook when I have many open? | Excel Discussion (Misc queries) | |||
Open a password protected excel workbook from second workbook to fetch data using dynamic connection | Excel Programming | |||
Close Open Workbook | Excel Programming | |||
Close Open Workbook | Excel Programming |