Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see ifi file is open

Status
Not open for further replies.

jennuhw

MIS
Apr 18, 2001
426
US
I have some code in an Outlook form that checks to see if a file is open before sending. It works fine, but once the form is able to be sent after the spreadsheet is available, it automatically closes my Outlook. If the file isn't open, and it is able to send without closing my Outlook. I am thinking that there is something in this segment of code that when the statement is true once is causes my problems. Any suggestions on why this might happen or any 'smoother' way of doing this? Thanks!


Set oWrkBook = oExcel.Workbooks.Open (FileLoc, 3, , , "purple" ,"purple",True)

If oWrkBook.ReadOnly Then
MsgBox ("You must wait for the log to become available.")
oWrkBook.Close 0
Item_Send = False
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top