View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Workbook.Open doesn't leave an open Workbook

Your code worked ok for me.

Guess #1. Any chance that that TS was opened, but was hidden (or you didn't
notice it)?

Guess #2. Any chance that you have your own variable named Err?





Mac Lingo wrote:

My Code:

TS = Directory & File_Name
On Error Resume Next
Workbooks.Open TS
If Err Then
Call MsgBox("Could not open " & TS & ", " & Err)
End If

After this runs, there is no Error Message, but there is no Workbook open
either.
This code works if I put in Workbook_Open, but not if I use it in a normal
Function call.

Any idea why it works in one place and not in another?

Thanks,
Mac


--

Dave Peterson