var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Runtime error:'3010; qryRanconProg' already exist
This error pops up (error: 'qryRanconProg' already exist) up when I run the below ONLY on the first DoCmd.
The second and third DoCmds work flawlessly.
I use these to past link data from an Access query to Excel files so I can link charts to them using Freelance Graphics.
Private Sub Command53_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "qryRanconProg", "D:\flw\Access\YTD", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "qryRanconMENFProg", "D:\flw\Access\YTD", True
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "qryRanconCustProg", "D:\flw\Access\YTD", True
MsgBox ("Finished Exporting to D:\FLW\ACCESS\YTD Documents")
Not the first time I've had this problem.
Does the file with the same name already exist? And does the file have a 'qryRanconProg' worksheet in it? That would be my guess. It is trying to overwrite existing data.
If the file exists, but you don't care about keeping it, then use the Kill commmand to delete the file before you try to export the data.
On Error Resume Next
On Error Goto 0
Where would this code be placed, before the DoCmd or after the exportSpreadsheet?
Also, will it break a link to an Excel sheet made from the previous DoCmd exPortSpreadsheet with the same name?
I have links from Access queries to Excel via the ExportSpreadsheet and they are identical and overwrite perfectly. My charts and then linked back to these spreadsheets.
The code should be put BEFORE the first DoCmd. What exactly do you mean by link? Do you have a Linked Table in an Access database? If so, as long as the filename is the same and you are storing it in the same location then it should be fine.
The suggested code did not defeat the error.
I have Access queries (lots of them) that need to export the query results to an Excel one page worksheet. No problem here except some flag the previous error that the "qryRanconProg" already exist. WHY?
The charts are linked into the Excel spreadsheets and as Freelance Graphics cannot link into Access.
Thanks . . . Rick
What happens if you switch the order of the DoCmds?