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
Excel copy from sheet1 to sheet2
Access Query Too Complex Error with Union Query
excel macro find selected range to use within macro
WSUS 3.0 server motherboard
Do not spell check or grammar was skipped.
Windows Scripting: FileSystemObject properties inconsistent with Windows Explorer values
aspx/c# looping through data from within body
what is the ip address of a web site? What happens when you change the ip address?
Receiving error code 0x800702e4 when trying to download with InDownloadMngr while in IE 8 with Win7 runing (64 bit) what do I do?
update query in access 2003 possible