At the end of the road on this problem,need any suggestion I can get. This is posted on another too.
VBA ProjectPassword
If I put this code on commandbutton it will open outlook in front of workbook,if I put a VBA Project password on it and close and save.When I reopen the workbook and run the code outlook opens behind the workbook? What does the password have to do with this? Looking for suggestions for a fix.
Thanks for looking Z
VBA ProjectPassword
If I put this code on commandbutton it will open outlook in front of workbook,if I put a VBA Project password on it and close and save.When I reopen the workbook and run the code outlook opens behind the workbook? What does the password have to do with this? Looking for suggestions for a fix.
Thanks for looking Z
Code:
Private Sub CommandButton1_Click()
Dim ol As Object
Dim ns As Object
Dim fldr As Object
Set ol = CreateObject("Outlook.Application")
Set ns = ol.GetNamespace("MAPI")
Set fldr = ns.GetDefaultFolder(6) 'inbox
fldr.Display
ol.ActiveWindow.Activate
End Sub