regis
February 17th, 2000, 08:37 AM
I open Excel file with this code
On Error Resume Next
Dim lRet As Long
Dim lOldCursor As Long
lOldCursor = Screen.MousePointer
Screen.MousePointer = vbHourglass
lRet = ShellExecute(0, "open", sLinkTo, "", vbNull, SW_SHOWNORMAL)
'MyAppID = Shell(sLinkTo, 1)
'AppActivate MyAppID
'SendKeys "^+G"
If lRet >= 0 And lRet <= 0 Then
Screen.MousePointer = vbDefault
MsgBox "Erreur d'ouverture avec le fichier " & sLinkTo & vbCrLf & _
vbCrLf & Err.LastDllError, , "ExecuteLink"
End If
Screen.MousePointer = vbDefault
But am not able to use SendKeys. Am able to start my Excel file but am not able to start my macro Excel with "^+G"
In the exemple code at line "lRet = Shell..." I start Excel File. The path file is in var "sLinkTo"
When the Excel file is Started I will like to start macro Excel "^+G"
I'am not familiar with function. Is't possible to you to help me.
Sorry for my english
Thanks
Redg
rpouliot@iqaff.qc.ca
On Error Resume Next
Dim lRet As Long
Dim lOldCursor As Long
lOldCursor = Screen.MousePointer
Screen.MousePointer = vbHourglass
lRet = ShellExecute(0, "open", sLinkTo, "", vbNull, SW_SHOWNORMAL)
'MyAppID = Shell(sLinkTo, 1)
'AppActivate MyAppID
'SendKeys "^+G"
If lRet >= 0 And lRet <= 0 Then
Screen.MousePointer = vbDefault
MsgBox "Erreur d'ouverture avec le fichier " & sLinkTo & vbCrLf & _
vbCrLf & Err.LastDllError, , "ExecuteLink"
End If
Screen.MousePointer = vbDefault
But am not able to use SendKeys. Am able to start my Excel file but am not able to start my macro Excel with "^+G"
In the exemple code at line "lRet = Shell..." I start Excel File. The path file is in var "sLinkTo"
When the Excel file is Started I will like to start macro Excel "^+G"
I'am not familiar with function. Is't possible to you to help me.
Sorry for my english
Thanks
Redg
rpouliot@iqaff.qc.ca