I have been trying to open a file using ShellExecute method in VB6, filename will be taken from a textbox within the form. But the file doesn't open and no errors too.
However the same method works smooth if i pass the file name directly instead of referring from a variable. Code below for reference. Not sure where problem exists but any help is much appreciated.
WorkingCode
ShellExecute 0, vbNullString, "F:\Desktop\SBKL\template.xlsx", vbNullString, vbNullString, vbNormalFocus
NonWorking Code
Dim FlNme As String
FlNme = Trim(Me.T_Doc_Link.Text)
ShellExecute 0, vbNullString, FlNme, vbNullString, vbNullString, vbNormalFocus
FlNme
variable when it fails? – RBarryYoungintReturn = ShellExecute(0, vbNullString, FlNme, vbNullString, vbNullString, vbNormalFocus)
. – RBarryYoung