
Sub Apri_Direct_Mar()
Dim FilePath As Variant
FilePath = ActiveSheet.Range("C14").Value
If FilePath = "" Then Exit Sub
ExecuteFile (FilePath)
End Sub
Public Sub ExecuteFile(FilePath As String)
On Error GoTo error
Dim ret As Integer
ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath), vbNormalFocus)
Exit Sub
error:
MsgBox Err.Description, vbExclamation, "Error"
End Sub
|
Sub Test()
ExecuteFile ("h t t p s://www.google.it")
End Sub
Public Sub ExecuteFile(FilePath As String)
On Error GoTo error
Dim ret As Integer
ret = Shell("rundll32.exe url.dll,FileProtocolHandler " & (FilePath), vbNormalFocus)
Exit Sub
error:
MsgBox Err.Description, vbExclamation, "Error"
End Sub
|
Sub Apri_Direct_Mar()
Dim FilePath As Variant, Fname As String
FilePath = ActiveSheet.Range("C14").Value
If FilePath <> "" Then
ChDir (FilePath)
Fname = Application.GetOpenFilename
If Fname <> "Falso" Then Workbooks.Open (Fname)
End If
End Sub
|
Sub Apri_Direct_Mar()
Dim FilePath As Variant, Fname As String
FilePath = ActiveSheet.Range("C14").Value
If FilePath <> "" Then
ChDrive (FilePath)
ChDir (FilePath)
Fname = Application.GetOpenFilename
If Fname <> "Falso" Then Workbooks.Open (Fname)
End If
End Sub |
