I use the following code at the begining of each macro that opens an Excel File. What I am looking for is to some how incorporate a procedure like this to check to see if the email that I want to open is already open or not.
NEXT, look at the 2nd set of code.
Dim oWB As Object
Dim PWB As String
Dim FSS As String
PWB = ("c:\MyMenuFiles\MyMenuiJngo.xls")
FSS = "MyMenuiJango.xls"
'First I need to check to see if "MyMenuiJango.xls" is open or not
If FileAlreadyOpen("c:\MyMenuFiles\MyMenuiJango.xls") = True Then
ActivateWorkbook (FSS)
Application.Quit
End
Else
The following code is currently what I use to open my 3 email accounts. This sample is for only 1, which is my hotmail account.
Next, see below this code.
Sub OpenMyeMailNo1()
Dim oShell
Dim sUrl As String
sUrl = "http://" & Sheets("Setup").Cells(8, 5).Value
Set oShell = CreateObject("Wscript.Shell")
oShell.Run (sUrl)
End Sub
This eMail code gets the name of the eMail and .com . . . EX: Hotmail.com from a sheet in the workbook named Setup from cell E8.
I know how to check to see if a file is already open or not, (don't want it opened 2X). BUT . . . How do I check to see if Hotmail or whatever email of the three I'm referring to is open or not.
Bookmarks