Rabu, 31 Mei 2023

Re: [MSAccessProfessionals] VBA Export to excel issue

Hi Jim,

What does your OutputTo code look like?  I use it all the time for automated processes to send a file out daily, and it always overwrites the previous file as desired.  Here's an example:

DoCmd.OutputTo acOutputQuery, "qryGetDriverInfo", acFormatXLS, "C:\AccessAp\DriversOver11.xls"

I suppose if it wasn't working for you the Kill command could first be used to delete the previous file, but in my experience that isn't needed.

Paul

------ Original Message ------
From: "Jim Wagner" <josephwagner2@outlook.com>
Sent: 5/31/2023 8:56:25 AM
Subject: [MSAccessProfessionals] VBA Export to excel issue

Hello all,
I am trying to export a query to excel. I have successfully exported to excel but each time I run the code, a new tab in the spreadsheet is added. I have tried many instances of docmd.transferspreadsheet and 
dcmd.OutputTo and 
Killpath code.
But neither have fixed the problem. I have done this before and never had this issue. Is there a different way?

Thank You so much for your help.

Jim Wagner

Re: [MSAccessProfessionals] VBA Export to excel issue

Hello all,
following up
It started to work. not sure what changed but it now works. 

Thank You 

Jim Wagner
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116377) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

[MSAccessProfessionals] VBA Export to excel issue

Hello all,
I am trying to export a query to excel. I have successfully exported to excel but each time I run the code, a new tab in the spreadsheet is added. I have tried many instances of docmd.transferspreadsheet and 
dcmd.OutputTo and 
Killpath code.
But neither have fixed the problem. I have done this before and never had this issue. Is there a different way?

Thank You so much for your help.

Jim Wagner
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#116376) | Reply To Group | Reply To Sender | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_