View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Put password for excel file in VB code


Hi,

Try this

Workbooks.Open "C:\book2.xls", Password:="MyPass"

Mike

"NANA" wrote:

Hello,
I open two new work books named as work book 1 and work book 2. i feed
some data in work book 1 and in work book i used one formula that is
=A1 from work book 1 and enter that value entered in work book. if put
password for work book 1 and save it and after that i open work book
2 that file ask update link or password to open the file. i just want
to ask the question is can it possible i put my password in VB code
because when i open my excel file that time never ask for password.or
i protect my only my VB coding.