Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a REXX program that runs and now outputs different TXT files depending
on a Race Track. At the end of the REXX is run the following VBS that opens Excel. I want to pass the VBS a variable filename. In REXX I would call RaceBetting.vbs filename How can I set up the VBS to accept the parm when run? And then how can I then pass this to the macro within Excel (below) [RaceBetting.vbs] -------------- Dim XLApp Dim XLWkb Set XLApp = CreateObject("Excel.Application") XLApp.Visible = true XLApp.Workbooks.Open "RaceBetting.xls" XLApp.ActiveWorkbook.RunAutoMacros 1 ---------------- In my macro I have the following code. Note filename was hardcoded below, I believe I have the syntax correct except on how to accept the passed-filename parm from the VBS file above. ---------------- Sub ImportRaceProgramData() ' Dim file_name As Variant Dim passed-filename As Variant (added) Worksheets("ProgramDataInput").Range("A3:H242").Cl earContents file_name = ThisWorkbook.Path & "\Cut-And-Paste-Into-XLS.txt" with (replaced) file_name = ThisWorkbook.Path & "\" & passed-filename with Worksheets("ProgramDataInput").QueryTables.Add(Con nection:= _ "TEXT;" & file_name _ more |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro get executed twice | Excel Discussion (Misc queries) | |||
No file when Save As is executed | Excel Programming | |||
No file when Save As is executed | Excel Programming | |||
How to create LOG file for commands executed in VB..? | Excel Programming | |||
Macro not executed Excel -- PowerPoint | Excel Programming |