Hi All
I am trying to get a piece of code working to just display and then close a notes database in Excel VBA. I can get the thing to display but cannot get it to close!
I am trying to use SendKeys but am not getting much luck.
Could someone have a look and tell me where I am going wrong please?
Private Sub CommandButton1_Click()
Dim WshShell As Object
Application.ScreenUpdating = False
Set WshShell = CreateObject("WScript.Shell")
Application.ScreenUpdating = False
On Error Resume Next
If Not Err.Number = 0 Then
Err.Clear
MsgBox "Notes is Not Running", vbInformation, "DEK"
Else
If Sheets("Web Pages").Range("A4").Value = "No" Then
Application.ActiveWorkbook.FollowHyperlink Address:="Notes://NotesUK1/80256BCA004FA06D/A21E6FA5142E261680256BD700477933", NewWindow:=True
Sheets("Web Pages").Range("A4").Value = "Yes"
Else
WshShell.AppActivate "Lotus Notes"
WshShell.SendKeys "^W"
Sheets("Web Pages").Range("A4").Value = "No"
End If
End If
FrontPage.Show
Exit Sub
End Sub
Thanks in advance!
Come on people, there must be someone here that knows about VBA with Lotus Notes!!
I am trying to get a piece of code working to just display and then close a notes database in Excel VBA. I can get the thing to display but cannot get it to close!
I am trying to use SendKeys but am not getting much luck.
Could someone have a look and tell me where I am going wrong please?
Private Sub CommandButton1_Click()
Dim WshShell As Object
Application.ScreenUpdating = False
Set WshShell = CreateObject("WScript.Shell")
Application.ScreenUpdating = False
On Error Resume Next
If Not Err.Number = 0 Then
Err.Clear
MsgBox "Notes is Not Running", vbInformation, "DEK"
Else
If Sheets("Web Pages").Range("A4").Value = "No" Then
Application.ActiveWorkbook.FollowHyperlink Address:="Notes://NotesUK1/80256BCA004FA06D/A21E6FA5142E261680256BD700477933", NewWindow:=True
Sheets("Web Pages").Range("A4").Value = "Yes"
Else
WshShell.AppActivate "Lotus Notes"
WshShell.SendKeys "^W"
Sheets("Web Pages").Range("A4").Value = "No"
End If
End If
FrontPage.Show
Exit Sub
End Sub
Thanks in advance!
Come on people, there must be someone here that knows about VBA with Lotus Notes!!
Last edited: