ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening EXCEL with additional Parameters (https://www.excelbanter.com/excel-programming/366874-opening-excel-additional-parameters.html)

edfollett[_2_]

Opening EXCEL with additional Parameters
 

Hey all,

Yet another question from me!

Basically i have an excel spreadsheet that will be distributed an
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 (
believe) a the last hurdle before i am finished. So please help if yo
can:

We want to open the Excel workbook i have created and pass additiona
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 th
VBA code?


i really hop e that makes sense!

e

--
edfollet
-----------------------------------------------------------------------
edfollett's Profile: http://www.excelforum.com/member.php...fo&userid=3622
View this thread: http://www.excelforum.com/showthread.php?threadid=56016


ppyxl[_7_]

Opening EXCEL with additional Parameters
 

If you only want the file name, u can use:

dim name as string

name=activeworkbook.nam

--
ppyx
-----------------------------------------------------------------------
ppyxl's Profile: http://www.excelforum.com/member.php...fo&userid=3611
View this thread: http://www.excelforum.com/showthread.php?threadid=56016


NickHK

Opening EXCEL with additional Parameters
 
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




Norman Jones

Opening EXCEL with additional Parameters
 
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






NickHK

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









All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com