Posted to microsoft.public.excel.programming
|
|
Opening EXCEL with additional Parameters
Norman,
Yea, too quick on the typing and too slow on the checking.
Cheers.
NickHK
"Norman Jones" wrote in message
...
Hi Ed,
Not that way, but
Dim WS as worksheet
set ws=application.worksheets.open(FullPathToFile)
Dim RetVal as variant
RetVal=Application.Run(ws.name & "!Your_Function", 1, 5, "Whatever")
I suspect that Nick intended Workbook rather than Worksheet, e.g.:
Dim WB As Workbook
Dim RetVal As Variant
Set WB = Application.Workbooks.Open(FullPathToFile)
RetVal = Application.Run("'" & WB.Name _
& "'!Your_Function", 1, 5, "Whatever")
I have also encased the workbook name in single quotes to allow for
possible
spaces in the wb name.
---
Regards,
Norman
--
---
Regards,
Norman
"NickHK" wrote in message
...
ed,
Not that way, but
Dim WS as worksheet
set ws=application.worksheets.open(FullPathToFile)
Dim RetVal as variant
RetVal=Application.Run(ws.name & "!Your_Function", 1, 5, "Whatever")
NickHK
"edfollett"
wrote
in message
...
Hey all,
Yet another question from me!
Basically i have an excel spreadsheet that will be distributed and
generated by a bespoke system the company i work for has created.
I have been asked to make a few alterations to the file and am (i
believe) a the last hurdle before i am finished. So please help if you
can:
We want to open the Excel workbook i have created and pass additional
parameters when opening the book
is there a way of doing somehting like the following:
open(C:\<file location\test.xls <parameter='test')
and then retrieve the parameter values (in this case test) within the
VBA code?
i really hop e that makes sense!
ed
--
edfollett
------------------------------------------------------------------------
edfollett's Profile:
http://www.excelforum.com/member.php...o&userid=36227
View this thread:
http://www.excelforum.com/showthread...hreadid=560162
|