#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 2 things

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default 2 things

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?

"Michael Wise" wrote in message
...
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





----== 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 =---
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 634
Default 2 things

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 :-)

--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03

----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission :-)
----------------------------------------------------------------------------



"Michael Wise" wrote in message
...
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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.608 / Virus Database: 388 - Release Date: 03/03/2004


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 2 things

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?

"Michael Wise" wrote in message
...
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





----== 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 =---
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 2 things

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.
-----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?

"Michael Wise" wrote in message
...
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





----== 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 =---
.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 2 things

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.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"Michael Wise" wrote in message
...
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?

"Michael Wise" wrote in message
...
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





----== 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 =---
.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default 2 things

You'll need to make a reference to the Microsoft Scripting Runtime library
in the VBA editor -Tools-References menu item
The basic operation is shown as follows......


Option Explicit
Public fso As New FileSystemObject

Public Sub DeleteFile()
Dim xfile As String
xfile = "C:\temp\temp.csv"

If fso.FileExists(xfile) Then
fso.DeleteFile (xfile)
MsgBox "File " & xfile & " deleted"
Else
MsgBox "File " & xfile & " not found"
End If

End Sub


Cheers
Nigel


wrote in message
...
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.
-----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?

"Michael Wise" wrote in message
...
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





----== 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 =---
.





----== 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 =---
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
Things to do with the cells DDD Excel Discussion (Misc queries) 1 December 8th 08 01:05 AM
A few things Bryan De-Lara[_2_] Excel Worksheet Functions 6 November 3rd 08 04:58 PM
Top 10 Things To Look For In A Web Host best_hosting Excel Worksheet Functions 0 September 14th 08 03:01 PM
######THEY DO DIFFERENT THINGS TO GET IT############# keerthi Charts and Charting in Excel 0 April 30th 08 07:45 AM
Counting Various Things robzrob Excel Worksheet Functions 2 April 22nd 08 07:50 PM


All times are GMT +1. The time now is 11:52 PM.

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

About Us

"It's about Microsoft Excel"