DaGeeza
Jul 25th, 2006, 08:41 AM
OK, guys I use what I think is a very good way of setting up the automation process with office.... here go's - dont be too harsh if you dont like it.
Public oApp as Object
Public Function ExcelOpen() As Boolean
ExcelOpen = False
Set oApp = Nothing
On Error Resume Next
Set oApp = GetObject(, "Excel.application")
If Err.Number > 0 Then
Set oApp = CreateObject("Excel.Application")
Err.Clear
End If
ExcelOpen = Not (oApp Is Nothing)
If Not ExcelOpen Then
MsgBox "Are you sure Microsoft Excel is installed on your computer?"
End If
End Function
This can be used to open up any office application, just copy and change the "Excel" bit.
Public oApp as Object
Public Function ExcelOpen() As Boolean
ExcelOpen = False
Set oApp = Nothing
On Error Resume Next
Set oApp = GetObject(, "Excel.application")
If Err.Number > 0 Then
Set oApp = CreateObject("Excel.Application")
Err.Clear
End If
ExcelOpen = Not (oApp Is Nothing)
If Not ExcelOpen Then
MsgBox "Are you sure Microsoft Excel is installed on your computer?"
End If
End Function
This can be used to open up any office application, just copy and change the "Excel" bit.