Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Sub OpenExcelReadOnly(strDoc As Variant)
Dim wapp As Object
Dim wdoc As Object
On Error Resume Next
Set wapp = GetObject(, "excel.application")
If Err.Number <> 0 Then
Err.Clear
Set wapp = CreateObject("excel.application")
If Err.Number <> 0 Then
Exit Sub
End If
End If
On Error GoTo ERR_OpenExcelReadOnly
Set wdoc = wapp.Workbooks.Open(strDoc, , True)
wapp.Visible = True
Set wdoc = Nothing
Set wapp = Nothing
ExitingSub:
Exit Sub
ERR_OpenExcelReadOnly:
[green] ' BugReport is my custom function to mail the programmer details on the errors encountered.[/green]
BugReport Err.Description, Err.Source, "Public Sub OpenExcelReadOnly(strDoc As Variant)"
Err.Clear
GoTo ExitingSub
End Sub