View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default How to open a book with parameters

Hi Daniel

To opem the secod workbook, run a pprocedure in the second workkbook and
pass it a parametric value, try somethinh like:

'============
Public Sub Tester()
Application.Run "'OtherBook.xls'!Demo", "Hello"
End Sub
'<<============

Where the second workbook has a procedure like:

'=============
Public Sub Demo(sStr As String)
MsgBox sStr
End Sub
'<<=============

Running the procedure Tester in the first workbook,
the second workbook will be opened (if it is closed)
and its Demo procedure will run and will report the
value of the passed parameter - in this case the string
"Hello".


---
Regards,
Norman


"Daniel" wrote in message
...
I have to open a book from another one and to pass to it somehow the value
of
a variable. Is it possible with VBA?

Thanks for helping me