- Search ExcelTip.com
directly from Excel
- Get immediate access to the
"Tip of the Hour"
- View hundreds of Microsoft
Excel tips with a click of a button
- Absolutely
Free - Click
here to download
Make your Amazon.com purchases by clicking the graphic below
|
Excel Tip .com - Mailing List Thread Index
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to quit application properly
Bill-
Maybe I should have told you that the macro is running in a template
and the template is renamed after the mac runs, so I don't really want to mess
with the template if that is what you are suggesting. Maybe I did not
understand your answer.
Jim
In a message dated 7/28/2003 4:38:07 PM Eastern Daylight Time,
Bill.Garland@FTNFINANCIAL.COM writes:
> As soon as you open it, save the ActiveWorkbook.Name to a string variable.
> Then you can Workbooks("string variable).Close (True/False) at the end of the
> code.
>
>
>
> -----Original Message-----
> From: Jim . [mailto:Escojpoer@AOL.COM]
> Sent: Monday, July 28, 2003 3:33 PM
> To: EXCEL-G@PEACH.EASE.LSOFT.COM
> Subject: How to quit application properly
>
>
> Hi-
> I am trying to open a wb and run a mac in that workbook, save it with
> a filename, open the next wb, run the mac, save it with a new name, then go
> back and close the original, but the original will not close. It has already
> been saved with the new filename, but it and the app still remain open.
> Actually
> I have 3 wbs to open and run macs and rename, but I am just working with
> these
> two right now. Need help. At the end of this code I open ITEHH.xls and run
> mac called Transfer. It runs and saves the file with a new name and closes
> the
> workbook, then the wb CAT3D62003(which has already been saved once by this
> mac)
> just stays open. How do I close it at the end of this code?? Thankx
> Jim
>
> **Upper code here***running in wb called CAT3D to be saved as CAT3D62003 by
> the following code
>
> ChDir "C:\Documents and Settings\JIM \My Documents\BackUp\ITEREBATES"
> ActiveWorkbook.SaveAs Filename:= _
> "C:\Documents and Settings\JIM \My Documents\BackUp\ITEREBATES\CAT3D"
> &Month(Now()) - 1 &Year(Now()) & ".xls", FileFormat:=xlNormal _
> , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
> CreateBackup:=False
> ChDir "C:\Documents and Settings\JIM \My Documents\Backup\ITEREBATES"
> Workbooks.Open Filename:= _
> "C:\Documents and Settings\JIM \My
> Documents\Backup\ITEREBATES\ITEHH.xls"
> Application.Run ("ITEHH.XLS!Transfer")
> ActiveWorkbook.Close Savechanges:=True'<<here is where it does not
> work
> Application.Quit
> Application.ScreenUpdating = True
> End Sub
>
--------------------------------------------------------------------------
The EXCEL-G list is hosted on a Windows NT(TM) machine running L-Soft
international's LISTSERV(R) software. For subscription/signoff info
and archives, see http://peach.ease.lsoft.com/archives/excel-g.html .
COPYRIGHT INFO:
http://peach.ease.lsoft.com/scripts/wa.exe?SHOWTPL=COPYRIGHT&L=EXCEL-G
|
And at your local bookseller


Excel Training Level I
Excel
Training Level II
Excel
Training Level III
Excel
VBA Training Level I
Excel
VBA Training Level II
View All Excel Training Programs

Formula Manager
Duplication
Manager
Text
Manager
Number
Manager
Add-ins
Collection
Spreadsheet
Assistant
Number
Manager
Add-ins
Collection
Spreadsheet
Assistant
View All Excel Add-Ins
|