Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a program that starts an instance of Excel 2002, creates a
spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua |
#2
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]() I assume you mean the EMF files generated by excel in the temp folder? These files are generated only/mostly? for embedded controls on worksheets. So your code may create sheets with embedded controls? Either: get rid of the embedded controls and replace with native controls from the form toolbar. close excel properly when your routine finishes. when excel is closed (not Terminiated via API) it should (and normally does) clear up any mess left in the temp dir. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: I have a program that starts an instance of Excel 2002, creates a spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua |
#3
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, in the TEMP folder. Sorry for not being specific.
To the best of my knowledge, I am not creating any embedded controls. In my VB.NET app, I have the following commands: xlbook.Close(False) xlapp.Quit() 'Release the references we have System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlsheet) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlbook) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlapp) Did I not close something properly? "keepITcool" wrote in message ... I assume you mean the EMF files generated by excel in the temp folder? These files are generated only/mostly? for embedded controls on worksheets. So your code may create sheets with embedded controls? Either: get rid of the embedded controls and replace with native controls from the form toolbar. close excel properly when your routine finishes. when excel is closed (not Terminiated via API) it should (and normally does) clear up any mess left in the temp dir. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: I have a program that starts an instance of Excel 2002, creates a spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua |
#4
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm an old VBA hack and I haven't yet found it necessary to
migrate to .Net interops etc. <g although your code makes sense to me.. I'd test following: clean the temp. run your code. check the temp.. and open the emf files to see what they are.. (and check that they are in fact generated by your code... that's it for me.. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: Yes, in the TEMP folder. Sorry for not being specific. To the best of my knowledge, I am not creating any embedded controls. In my VB.NET app, I have the following commands: xlbook.Close(False) xlapp.Quit() 'Release the references we have System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlsheet) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlbook) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlapp) Did I not close something properly? "keepITcool" wrote in message ... I assume you mean the EMF files generated by excel in the temp folder? These files are generated only/mostly? for embedded controls on worksheets. So your code may create sheets with embedded controls? Either: get rid of the embedded controls and replace with native controls from the form toolbar. close excel properly when your routine finishes. when excel is closed (not Terminiated via API) it should (and normally does) clear up any mess left in the temp dir. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: I have a program that starts an instance of Excel 2002, creates a spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua |
#5
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
Apparently, the problem does lie in bad code. My code basically puts data
from an array into various cells, gives the worksheet a background, prints the sheet, and closes. The mso*.emf file that is left is a copy of the background image. Weird. Oh well. I'll probably just create a scheduled task then to delete these files on a regular basis. Thanks for your help! Joshua "keepITcool" wrote in message ... I'm an old VBA hack and I haven't yet found it necessary to migrate to .Net interops etc. <g although your code makes sense to me.. I'd test following: clean the temp. run your code. check the temp.. and open the emf files to see what they are.. (and check that they are in fact generated by your code... that's it for me.. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: Yes, in the TEMP folder. Sorry for not being specific. To the best of my knowledge, I am not creating any embedded controls. In my VB.NET app, I have the following commands: xlbook.Close(False) xlapp.Quit() 'Release the references we have System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlsheet) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlbook) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlapp) Did I not close something properly? "keepITcool" wrote in message ... I assume you mean the EMF files generated by excel in the temp folder? These files are generated only/mostly? for embedded controls on worksheets. So your code may create sheets with embedded controls? Either: get rid of the embedded controls and replace with native controls from the form toolbar. close excel properly when your routine finishes. when excel is closed (not Terminiated via API) it should (and normally does) clear up any mess left in the temp dir. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: I have a program that starts an instance of Excel 2002, creates a spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua |
#6
![]()
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
![]()
I use this VBS script to clean up my Temp folder on demand. I have a shortcut
to the script on my desktop. http://groups.google.com/groups?thre...%40tkmsftngp02 Joshua Campbell wrote: Apparently, the problem does lie in bad code. My code basically puts data from an array into various cells, gives the worksheet a background, prints the sheet, and closes. The mso*.emf file that is left is a copy of the background image. Weird. Oh well. I'll probably just create a scheduled task then to delete these files on a regular basis. Thanks for your help! Joshua "keepITcool" wrote in message ... I'm an old VBA hack and I haven't yet found it necessary to migrate to .Net interops etc. <g although your code makes sense to me.. I'd test following: clean the temp. run your code. check the temp.. and open the emf files to see what they are.. (and check that they are in fact generated by your code... that's it for me.. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: Yes, in the TEMP folder. Sorry for not being specific. To the best of my knowledge, I am not creating any embedded controls. In my VB.NET app, I have the following commands: xlbook.Close(False) xlapp.Quit() 'Release the references we have System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlsheet) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlbook) System.Runtime.InteropServices.Marshal.ReleaseComO bject(xlapp) Did I not close something properly? "keepITcool" wrote in message ... I assume you mean the EMF files generated by excel in the temp folder? These files are generated only/mostly? for embedded controls on worksheets. So your code may create sheets with embedded controls? Either: get rid of the embedded controls and replace with native controls from the form toolbar. close excel properly when your routine finishes. when excel is closed (not Terminiated via API) it should (and normally does) clear up any mess left in the temp dir. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Joshua Campbell" wrote: I have a program that starts an instance of Excel 2002, creates a spreadsheet, prints it, and closes. It does this roughly 400 times a day. As you can imagine, this means that a lot of .emf files are going to be created by Excel, and this can fill up a hard drive if left unchecked. Is there a way to keep Excel from creating these files? Thanks. Joshua -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2002: Can I save all files in one go without exiting ? | Excel Discussion (Misc queries) | |||
Excel 2002 : Unable to open files in MS Outlook 2002 | Excel Discussion (Misc queries) | |||
Files saved in excel 2002 | Excel Discussion (Misc queries) | |||
corrupt Excel 2000/2002 files | Excel Discussion (Misc queries) | |||
Excel 2002 files attached to Outlook 2002 EMails change size | Excel Programming |