Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default How to open a book with parameters

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 354
Default How to open a book with parameters

Hi Norman:
Simple and clear. Great explanation. Thanks!

"Norman Jones" wrote:

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




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
How to open new book (workbook) with other ahoc Excel Discussion (Misc queries) 1 July 20th 09 02:33 AM
hyperlink to other sw(exe) and open with parameters L@ja Excel Worksheet Functions 2 August 28th 08 08:28 PM
Open Another Book Carpe Diem Excel Programming 2 February 9th 07 04:48 PM
SHELL to open an application and pass parameters to it jwkz Excel Programming 3 August 12th 05 09:41 PM
Open book, check for macros, close book Robin Hammond[_2_] Excel Programming 5 March 31st 05 06:09 PM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"