2 things

M

Michael Wise

I can not get Excel to quit. I am using application.quit
second item is after this code.
Here is code:

Open word
Dim WordApp As Object
Set WordApp = CreateObject("Word.Application")
WordApp.Documents.Open "c:\PSV Travelog\Travelog
Template.dot"
WordApp.Visible = True
WordApp.Documents("Travelog Template.dot").Close
SaveChanges:=False

'-------------------
'Close Excel

Application.DisplayAlerts = False
'Workbooks("PSV WO and Specs.xls").Close 'Close
Excel
Application.Quit

'------------------
'Program Ending

' --- Do not modify ---
GoTo EndMain
Main_Err:
Main_Error_Handler

EndMain:

End_Text = "Macro Finished" & vbCrLf _
& "Time Started :" & Start_Time & vbCrLf _
& "Time Completed:" & Now & vbCrLf _
& "Your File is Open in word you may print it
now!"
End_Macro End_Text
End Sub ' Main

second item- How can I delete an .csv file after a
mailmerge takes place in a .dot

Michael
 
K

Ken Wright

Would I be wrong in thinking this code is stored in the workbook called "PSV WO
and Specs.xls" - If so then read on, else ignore this note:-

Think about it logically from a step by step basis, and concentrate solely on
your Close Excel section, and keep in mind where this macro is actually stored:-

Step1
'Close Excel

Application.DisplayAlerts = False

No problem so far, we've stopped the error messages

Step2
'Workbooks("PSV WO and Specs.xls").Close 'Close

OK, now we are closing this workbook (ie hint - the one that contains the macro
that contains step3 to close Excel)

Step3
Excel
Application.Quit

Now how much chance do you think you have of actually getting here, given what
you have just done in step2 :)
 
M

Michael Wise

Nope wanna delete the .csv from within word.
-----Original Message-----
I thought this thread had already been discussed ??

Deleting a csv is no different to deleting any other file, do you mena from
within Excel?






----== Posted via Newsfeed.Com - Unlimited-Uncensored- Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
.
 
G

Guest

Nigel,

I looked for deleting of files and only found issues with
rows, colums and such. I want to delete a .csv file from
within word and this .csv file is not open. It's the data
file that is used for the mailmerge. After the mailmerge
i'm done with this particular data in this file.
 
H

Harald Staff

Select it in Word's File > Open menu and press the Delete button on the keyboard.

Or do you mean with a Word VBA macro ? Use the Kill command.
 
Top