View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default if its open...close it

Using the extension always works, regardless of the setting.

--
Regards,
Tom Ogilvy

"Harald Staff" wrote in message
...
"Dave Peterson" skrev i melding
...
If the workbook Commission had the .xls extension, I think I'd specify

it:

On Error Resume Next
Workbooks("commission.xls").Close SaveChanges:=False
On Error GoTo 0


That will err if the file extension is hidden. To be safe, use both:

On Error Resume Next
Workbooks("commission").Close SaveChanges:=False
Workbooks("commission.xls").Close SaveChanges:=False
On Error GoTo 0

Best wishes Harald