View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gustaf Gustaf is offline
external usenet poster
 
Posts: 69
Default Open second Excel file with VBA

Dave Peterson wrote:

I'd use:

sheetName = ActiveWorkbook.ActiveSheet.Name
set ws = nothing
on error resume next
Set ws = xlTmp.Sheets(sheetName)
on error goto 0
If ws is nothing Then


Great, it works! But what's the meaning of "On Error GoTo 0" here? It appears the only error I need to look out for is that sheetName is out of range.

Gustaf