Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Additional rows added to spreadsheet when opening text files | Excel Discussion (Misc queries) | |||
How do I get additional fonts in Excel? | Excel Discussion (Misc queries) | |||
Additional thread in VB in Excel | Excel Programming | |||
Excel Parameters | Excel Programming | |||
Excel Parameters??? | Excel Programming |