ich würde gerne aus Excel eine Word-Datei (.docx) im Browser öffnen (u. a. wegen Schreibschutz).
Der Ordnerpfad steht in einer Zelle, die zu öffnende Datei in einer ListBox (Formular).
Leider funktioniert mein Versuch nicht, die Word-Datei im Browser zu öffnen. Als .docx (Originalendung) funktioniert es.
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim objFolder As String
Dim appIE As Object
Dim URL As String
Dim FileToURL As String
On Error Resume Next
objFolder = ActiveSheet.Range("B1").Value 'Ordnerpfad
FileToURL = Left(ListBox1.Value, InStrRev(ListBox1.Value, ".") - 1) & ".html" 'Word-Datei, _
Endung als .html
URL = objFolder & Application.PathSeparator & FileToURL 'Pfad zusammensetzen
Set appIE = CreateObject("InternetExplorer.application")
appIE.Visible = True
appIE.navigate URL
Set appIE = Nothing
End Sub
Vielleicht kann mir jemand einen Tipp geben.Vielen Dank schon mal
Gruß
Werner