Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export of select query data to excel in Access 2007
Hello,
to export the select query data to excel file in VBA code you can use DoCmd.OutputTo or DoCmd.TransferSpreadShet method. Ok, you can use both types as a macro action too. In my applications I'm using both versions. In one of my programs I have to transfer the data every night to the same excel file. Because of the fact that the file of the fixed name has been existing from the previous night Access program always notices me about that and asks me to overwrite the file. I don't find any argument (parameter) in either of methods to demand default overwriting. I want to avoid to click all the times, so I want to automate the overwriting. Is there really the only solution to delete the excel file first and only then export the query data to the file, which will be new created? Or did I overlook any fact? Ivan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export of select query data to excel in Access 2007
I don't speak the Access, but doesn't its flavor of VBA support the Kill
command. In excel's flavor of VBA, I'd either use Kill (to delete the existing file first) or application.displayalerts = false 'do the save application.displayalerts = true If this doesn't help and you don't get a good answer here, I'd ask in a forum dedicated to Access. Ivan wrote: Hello, to export the select query data to excel file in VBA code you can use DoCmd.OutputTo or DoCmd.TransferSpreadShet method. Ok, you can use both types as a macro action too. In my applications I'm using both versions. In one of my programs I have to transfer the data every night to the same excel file. Because of the fact that the file of the fixed name has been existing from the previous night Access program always notices me about that and asks me to overwrite the file. I don't find any argument (parameter) in either of methods to demand default overwriting. I want to avoid to click all the times, so I want to automate the overwriting. Is there really the only solution to delete the excel file first and only then export the query data to the file, which will be new created? Or did I overlook any fact? Ivan -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export of select query data to excel in Access 2007
I woul like to excuse myself. I have been noticed that I sent my question to
wrong group (my fingers were too fast), but it was to late and I couln't erase my post later anymore. The same question is now in an access group too. And thank you for your help, Dave. Ivan "Dave Peterson" wrote in message ... I don't speak the Access, but doesn't its flavor of VBA support the Kill command. In excel's flavor of VBA, I'd either use Kill (to delete the existing file first) or application.displayalerts = false 'do the save application.displayalerts = true If this doesn't help and you don't get a good answer here, I'd ask in a forum dedicated to Access. Ivan wrote: Hello, to export the select query data to excel file in VBA code you can use DoCmd.OutputTo or DoCmd.TransferSpreadShet method. Ok, you can use both types as a macro action too. In my applications I'm using both versions. In one of my programs I have to transfer the data every night to the same excel file. Because of the fact that the file of the fixed name has been existing from the previous night Access program always notices me about that and asks me to overwrite the file. I don't find any argument (parameter) in either of methods to demand default overwriting. I want to avoid to click all the times, so I want to automate the overwriting. Is there really the only solution to delete the excel file first and only then export the query data to the file, which will be new created? Or did I overlook any fact? Ivan -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export of select query data to excel in Access 2007
Did you look in Access's VBA's help for Kill?
I bet it's there. Ivan wrote: I woul like to excuse myself. I have been noticed that I sent my question to wrong group (my fingers were too fast), but it was to late and I couln't erase my post later anymore. The same question is now in an access group too. And thank you for your help, Dave. Ivan "Dave Peterson" wrote in message ... I don't speak the Access, but doesn't its flavor of VBA support the Kill command. In excel's flavor of VBA, I'd either use Kill (to delete the existing file first) or application.displayalerts = false 'do the save application.displayalerts = true If this doesn't help and you don't get a good answer here, I'd ask in a forum dedicated to Access. Ivan wrote: Hello, to export the select query data to excel file in VBA code you can use DoCmd.OutputTo or DoCmd.TransferSpreadShet method. Ok, you can use both types as a macro action too. In my applications I'm using both versions. In one of my programs I have to transfer the data every night to the same excel file. Because of the fact that the file of the fixed name has been existing from the previous night Access program always notices me about that and asks me to overwrite the file. I don't find any argument (parameter) in either of methods to demand default overwriting. I want to avoid to click all the times, so I want to automate the overwriting. Is there really the only solution to delete the excel file first and only then export the query data to the file, which will be new created? Or did I overlook any fact? Ivan -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Export of select query data to excel in Access 2007
Yes it is. A detail from Help:
Kill Statement Deletes files from a disk. Syntax Kill pathname -- Regards, Ivan "Dave Peterson" wrote in message ... Did you look in Access's VBA's help for Kill? I bet it's there. Ivan wrote: I woul like to excuse myself. I have been noticed that I sent my question to wrong group (my fingers were too fast), but it was to late and I couln't erase my post later anymore. The same question is now in an access group too. And thank you for your help, Dave. Ivan "Dave Peterson" wrote in message ... I don't speak the Access, but doesn't its flavor of VBA support the Kill command. In excel's flavor of VBA, I'd either use Kill (to delete the existing file first) or application.displayalerts = false 'do the save application.displayalerts = true If this doesn't help and you don't get a good answer here, I'd ask in a forum dedicated to Access. Ivan wrote: Hello, to export the select query data to excel file in VBA code you can use DoCmd.OutputTo or DoCmd.TransferSpreadShet method. Ok, you can use both types as a macro action too. In my applications I'm using both versions. In one of my programs I have to transfer the data every night to the same excel file. Because of the fact that the file of the fixed name has been existing from the previous night Access program always notices me about that and asks me to overwrite the file. I don't find any argument (parameter) in either of methods to demand default overwriting. I want to avoid to click all the times, so I want to automate the overwriting. Is there really the only solution to delete the excel file first and only then export the query data to the file, which will be new created? Or did I overlook any fact? Ivan -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using MS Query with Excel and Access 2007 | Excel Discussion (Misc queries) | |||
Excel 2007 - Query MS Access DB | Excel Discussion (Misc queries) | |||
Excel 2007 Query Wizard problem with Access 2007 extensions | Excel Discussion (Misc queries) | |||
Import Access query to Excel 2007 | Excel Discussion (Misc queries) | |||
Export to Access, Workbook Treated as a Query Response | Excel Discussion (Misc queries) |