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

"Dave Peterson" wrote in message
...
Yes you did.

But I have a difficult time picking out your response from the
intermingled
text.

I am using MS Outlook Express Newsgroup to access this forum. Its newsreader
shows the reply to my post together. So there is no problem following the
thread


I couldn't duplicate your problem.

Are you sure that the button points to the correct macro in the correct
workbook.

Nooooo. The macro procedure attached to the button located in the toolbar
works well but it doesn't work properly when it is called up inside another
procedure. That's what I've been saying.

You may have noticed that most people top post in the excel newsgroups. I
find
it easier to read and follow. You may want to do that, too.

I thought I was when I selected "microsoft.public.excel.misc." to subscribe
from the list of Newsgroups inside Outlook Express. Is there another way?

Tom wrote:

"Dave Peterson" wrote in message
...
I meant that maybe you made a change to the suggested code and you
didn't
share
it in your follow-up post. Share your curent version.

In my first reply I pointed out that the codes did exactly as I wanted.
Meaning that they did work. I placed a button
in the toolbar to activate it. Here they a
Sub Reload()

' Reload the active document.
With Application
.DisplayAlerts = False
.ScreenUpdating = False
End With
Dim wkbkFullName As String
Dim wkbk As Workbook
With ActiveWorkbook
wkbkFullName = .FullName
.Close savechanges:=False
End With
Set wkbk = Workbooks.Open(Filename:=wkbkFullName)
With Application
.DisplayAlerts = True
.ScreenUpdating = True
.StatusBar = False
End With
End Sub

But maybe it's the location of the code. If you put it in the
activeworkbook's
project, then as soon as the activeworkbook closes, the code stops. It
has to
be in a different workbook.

My next reply pointed out that they were located in the file Personal.xls
When used in another document that has many buttons to allow many
funtions
to be
performed on the document, I wanted the document to reload before the
user
activates
another function and without having to click on the "Reload Button" on
the
toolbar.
Hence, within each of the other function procedures, I included the line:
Application.Run "'Personal.xls'!Module10.Reload"
but the document just closed down even though the "Reload" procedure was
in
a different location
different from that of the document. Because there are many other
documents
each with their own
individual functions that can be performed on them, I don't want having
to
place the "Reload" procedure
in each one of them.


Tom wrote:

"Dave Peterson" wrote in message
...
Maybe you made another change you didn't share???
I don't follow. Do you mean share as in, "Sharing Directory" within MS
Windows Explorer? If so that wasn't the case as all the documents used
were
in the same directory location.

I would have guessed that either the workbook would open or you'd
see
an
error message.
Neither. The active workbook just closed with no error message.

<<snipped


--

Dave Peterson