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
Tivoli Storage Manager Backup Archive Client App Crash DSM.EXE after installing on Windows Server 2008 R2 64 bit
I need help with an ODBC Connection with Access 2007
IntoPath-How to populate a non-repeating field with a repeating field value on a condition
IE7 ! Error On Page and/or ! Done
VBA Export Tab Delimited text file
Change IP Address of Windows 2000 Domain Controller
How to hyperlink a database of 1000's of Fedex tracking numbers to their own tracking Fedex webpage for beginner?
Using GetDate function to ruturn results
How to add a team discussion to a task list
Windows 7 remote desktop causes black screen and am forced to cold boot