code for closing out an excel file while in the browser?

G

Guest

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 I’m 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
 
G

Guest

Try this:

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

JLGWhiz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top