The next script finds the open session of Excel and call procedure 'MyProc'. It works without passing an argument. I mean the procedure is called if I do not add ', x'. When I tray to pass the argument it looks that it is a sintax probmem in the code...
Procedure in Excel 'MyWorkbook to be called.xlsm' is:
Code:
x = "q"
Set ExcelDeschis = GetObject(,"Excel.application")
With ExcelDeschis
.Run "'MyWokbook to be called.xlsm'!myProc", x
End With
Set ExcelExistent = Nothing
Code:
Sub myProc(Optional Z as string)
MsgBox Z & " has been received..."
End Sub
Can anybode help in order to write the code to prerly pass the argument 'x' to procedure myProc?
Thanks in advance!