Hello.
As part of my internship I am writing a makro. Ultimatly I want to start it with an batch file. To keep stuff simple I tried to start a small makro with dynamic parameters just like in an old thread (http://forums.codeguru.com/showthrea...-outside-excel).
For testing purpose everything resides in the same folder under c:\script\
The excel file with the makro is called: main.xlsm
makro code:
Code:
Sub Proc(sParam1 As String, iParam2 As Integer)
MsgBox sParam1 & " is " & iParam2 & " Years Old"
End Sub
batch file:
Code:
@echo off
cscript c:\script\test.vbs
pause
vbs file:
Code:
Option Explicit
Private Sub SimpleCall()
Dim oExcelApp As Object
set oExcelApp = oExcelApp.Workbooks.Open("C:\script\main.xlsm")
oExcelApp.Visible = True
oExcelApp.run "Modul2.proc", "David", "30"
End Sub
Thank you very much in advance!!
cheers