View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Tom Tom is offline
external usenet poster
 
Posts: 13
Default Closing and reopening the same file

Thank you Dave. That's wonderful. It did exactly what I hoped it would do.
Just a couple of questions:
1. Does Excel capture the name of the active document with the line,
wkbkfullname = .fullname ?
2. The use of dot (.) fascintes me. Where can I find out how else it can be
used? Am not a programmer.

TIA
Tom

"Dave Peterson" wrote in message
...
It won't change the way the code works, but it looks more natural:

Dim wkbkFullName as string
dim wkbk as workbook
with activeworkbook
wkbkfullname = .fullname
.close savechanges:=false
end with
set wkbk = workbooks.open(filename:=wkbkfullname)




Dave Peterson wrote:

If you're running this from a different workbook, but want to close the
activeworkbook.

Dim wkbkFullName as string
dim wkbk as workbook
with activeworkbook
wkbkfullname = .fullname
.close savechanges:=false
set wkbk = workbooks.open(filename:=wkbkfullname)
end with



Tom wrote:

I need a macro to close an open file but without saving its changed
content.
Then reopen it again. Hence, the macro will have to be able to read the
filename first and use that name to reopen it. Any help is much
appreciated.

TIA
Tom


--

Dave Peterson


--

Dave Peterson