Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Order of open/close

Hello

I have a workbook that prompts a person to save the workbook. When the
workbook is saved, it is given a new name and then the original file
(template without xlt) is opened and the named file is closed.

In my code, I refer to Thisdocument.path and Activedocument.path.

Here's the problem. If I open the original document before closing the
saved on, it comes up with the filename of talktime1.xls instead of
Time.xls; because the original file is still in memory. So in my code where
I refer to Thisdocument.path and Activedocument.path, it is referring to
some temp folder on the machine.

How can I get by this and have the original document opened from its
original source? (Files folder where the Talktime.xls file is).
Thisworkbook.path says it is ""
Filename says "\Talktime1.xls" (after the file is opened)
Original filename is talktime.xls in the Files folder.
Saved filename should be Talk Time date -- time.xls (and it is) in the
Files\Results folder (and it is)

Seems to me that the saved file has to be closed first, but by doing that I
stop program execution.

thefilename = pth & "Talk Time" & " " & Tdate & " -- " & TTime
Application.ThisWorkbook.SaveAs (thefilename & " " & TTime & ".xls")


Workbooks.Open (wbp & "talktime.xls")
Workbooks(thefilename).Close savechanges:=False

Hope this makes sense to someone.

Thank you so much
Terry V


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Open & Odd Close ohsix Excel Discussion (Misc queries) 0 May 19th 07 05:32 AM
Open Close workbooks bbc1 Excel Discussion (Misc queries) 2 August 28th 05 11:24 AM
if its open...close it choice[_2_] Excel Programming 10 August 16th 04 01:19 PM
Open then Close Markus Excel Programming 2 July 14th 04 07:44 PM
On Open/On Close Jeff Excel Programming 3 June 9th 04 10:23 PM


All times are GMT +1. The time now is 11:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"