Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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







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
Additional rows added to spreadsheet when opening text files kidofseph Excel Discussion (Misc queries) 0 April 25th 07 09:54 PM
How do I get additional fonts in Excel? Shelton Excel Discussion (Misc queries) 1 March 9th 06 11:55 PM
Additional thread in VB in Excel Sverre Excel Programming 0 June 8th 04 01:13 PM
Excel Parameters Dan[_33_] Excel Programming 2 April 15th 04 03:06 PM
Excel Parameters??? Telly Massaras Excel Programming 7 December 18th 03 07:06 PM


All times are GMT +1. The time now is 12:20 AM.

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"