Visual Basic for Excel question (closing a window)

  madwab 09:44 08 Jul 2004
Locked

I'm trying to close the active window and discard changes. I've only figured out how to close it and be prompted. My VB book says

ActiveWindow.Close ([savechanges])

will save changes, which it does; it then says 'set SaveChanges to False to have changes discarded but doesn't say how. I've tried

ActiveWindow.Close (savechanges = False)
...which opens the save as screen
ActiveWindow.Close ([savechanges = False])
...which opens the save prompt
ActiveWindow.Close ([savechanges] = False)
...which gives an error

...and a couple of other variations. What's the correct format?

Thanks

  madwab 09:50 08 Jul 2004

(answer below)

ActiveWindow.Close savechanges:=False

  VoG II 09:52 08 Jul 2004

ActiveWindow.Close savechanges := False

  VoG II 09:52 08 Jul 2004

Doh!

  VoG II 09:52 08 Jul 2004

Doh!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Ryzen news - release date, UK price, features and specifications

The pulp art of 80s computer game magazine covers

Best value Mac: Which is the best £1249 Mac to buy

Comment faire des captures d’écran sous Windows 10 ?