Source of Excel File

rahulbassi

Board Regular
Joined
Aug 14, 2011
Messages
130
Hello All,

How can we know whether the excel file is opened from a batch file accessed through Command prompt Or manually by double click.
Need to call different functions based upon this condition.

Thanks in advance.

Thanks,
Rahul
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

rahulbassi

Board Regular
Joined
Aug 14, 2011
Messages
130
Just found the solution to old problem. Sharing here for others...

Code:
 arrayArgs = Split(CmdLine, "/e/")

 If UBound(arrayArgs) > 0 Then        'Get the string Paramters
        arg_exist = True
    Else
        'There are no parameters; Opened manually
        arg_exist = False
    End If
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,082
Messages
5,466,537
Members
406,485
Latest member
kaksolver

This Week's Hot Topics

Top