Hi,
I realy need to pass aruments to macro(Auto_Open)s of excel file from
command prompt.
I tried with following code
-----------------------------------------------------------------------------
Declare Function GetCommandLine Lib "kernel32" _
Alias "GetCommandLineA" () As Long
Declare Function lstrlen Lib "kernel32" _
Alias "lstrlenA" (ByVal lpString As Long) As Long
Declare Function lstrcpy Lib "kernel32" _
Alias "lstrcpyA" (ByVal lpDestString As String, )
ByVal lpSrcString As Long) As Long


Sub Test()
MsgBox CommandLine()
End Sub


Function CommandLine() As String
Dim Ptr As Long, Length As Long, VBString As String


Ptr = GetCommandLine() 'pointer to the buffer
Length = lstrlen(Ptr) 'length of null-terminated string
VBString = Space$(Length) 'allocate buffer
lstrcpy VBString, Ptr 'copy the string: note the order of the
args!
CommandLine = VBString
End Function
------------------------------------------------------------------------------
I used command line as
>start excel c:\myfolder\myexcel.xls /e/123/hello/abc

but it's ignoring arguments at the end of command line(after space)
I did n't get why that getCommandLine function is not taking full
arguments.

it's taking till "excel.exe c:\myfolder\myexcel.xls" and ignoring
agruments after taht.
I have doubt am i using correct switch(/e for arguments).
So please let me know what's problem that.

pls help me in soving this problem

regards
poli