View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default code for closing out an excel file while in the browser?

Try this:

Private Sub CommandButton4_Click()
Range("a1").Select
Range("b11").Select
ThisWorkbook.Saved = True
ThisWorkbook.Close
End Sub

JLGWhiz

"Tom" wrote:

I am using Excel 2003, FrontPage 2003 and internet explorer. I can access the
excel file from my browser but can not close the excel file with a command
button while the file is working from the browser. If I am working from the
excel program itself, the button works but not from the browser. The range
code is to get back to the top before quitting and I do not want any changes
to the file to be saved. As you can tell Im in the learning mode. Thanks.
Wayne

Private Sub CommandButton4_Click()
Range("a1").Select
Range("b11").Select
Workbooks("KHC WEB 1.04.XLS").Close SaveChanges:=False
End Sub