Microsoft
Software
Hardware
Network
Question : Good practice on writing file, creating directory, etc.
I have an Access application that is using: DoCmd.OutputTo acReport, "rptTemplate", "Microsoft Excel 97-2003", "sample.xls", False
to output reports in excel format. I found a problem: when i call the command again, the reports got appended, thus the file is doubled. What is the solution? Shall I clear the same file name first each time? Also, since my destination directory has a lot of space between characters, sometimes, it failed to create a directory. And there is shared violation problem too when other people tred to delete the file. Just want to get some good sample code on create directory(if it doesn't exisit) or use the existent directory, clear destination file with the same name, etc. Thanks.
Answer : Good practice on writing file, creating directory, etc.
If you do not need the previous file, you can delete it programmatically:
You can use VBA Kill statement to delete files: Kill path & filename
eg. Kill c:\filename.xls
Jacob
Random Solutions
How do I encrypt a string so that it is suitable to be a filename?
can you help me? the problem in registering DTS dll files.
Icons on desktop don't completely refresh
how can i in Java language update a VFP table dbf
Rename "Pinned" Remote Desktop Connections
Access 2003 image browser form?
Windows 2008 certutil -keyrecover fails when I try to recover a key.
SUMPRODUCT not working
ASP.NEt Error : "An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file "
in word 2003 the right align field is grayed out when I try to add a TOC