View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,comp.databases.ms-access
Anthony Cuttitta Jr. Anthony Cuttitta Jr. is offline
external usenet poster
 
Posts: 8
Default Finding Real Worksheet Name After Access Export

[Sorry for the cross-post, but it may be an issue either group may
have the answer to through experience.]

I'm working on some procedures where Access queries are exported to
Excel, and then later on, those same workbooks are openned, and I need
to target a specific original sheet. Sometimes there will be multiple
sheets in the same workbook, sometimes only a single tab.

The issue is this: Save query "XLTest - qryExport" to file and the
worksheet name becomes "XLTest___qryExport" (three underscores). I
have a generic procedure which performs the export, so if exported
multiple times, there is no error. However, if saved manually (File |
Save As...), I'll get "The object 'XLTest - qryExport' already
exists...".

Looking at Worksheet.Name in Excel, I can find "XLTest___qryExport".
I've tried browsing the entire object tree but don't see "XLTest -
qryExport" anywhere.

Is it there, or is Access throwing out this message after interpreting
a message thrown back from trying to save the query object?

Thanks in advance. Again, sorry for the cross-post.

Anthony.