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.
[blue]Sub toggleprojectwisecomaddin()
Dim lngIndex As Long
For lngIndex = 1 To Application.COMAddIns.Count
If Application.COMAddIns(lngIndex).Description = "ProjectWise iDesktop Integration" Then [COLOR=green]' possible your Projectwise comm addin name may vary[/color]
Application.COMAddIns(lngIndex).Connect = Not Application.COMAddIns(lngIndex).Connect [COLOR=green]' toggle connect status[/color]
Exit For
End If
Next
End Sub[/blue]
MS description of office switches, for word:strongm said:/a doesn't stop com addins ...
Public Sub Test()
Dim appWord As Word.Application
On Error Resume Next
Set appWord = GetObject(, "Word.Application")
If Err.Number = 0 Then
MsgBox "Close Word and start again"
Set appWord = Nothing
Else
Err.Clear
On Error GoTo 0
ID = Shell("winword.exe /a", vbMaximizedFocus)
Set appWord = GetWord(30)
If appWord Is Nothing Then
MsgBox "Need a bit more time..."
Else
appWord.Visible = True
End If
End If
End Sub
Public Function GetWord(MaxWaitSeconds As Integer) As Word.Application
On Error Resume Next
For i = 1 To MaxWaitSeconds
Application.Wait (Now + TimeValue("0:00:01"))
DoEvents
Set GetWord = GetObject(, "Word.Application")
If Err.Number <> 0 Then Err.Clear Else Exit For
Next i
MsgBox i
End Function