[AccessD] A2010 - Export Query Results to Excel - Plus some other bits

Paul Hartland paul.hartland at googlemail.com
Mon Aug 14 23:35:59 CDT 2023


I think the best way to go especially if you want the nice to have with the
dd_mmm_yyyy_x is to create your own function writing out using the Excel
object, that way you can loop tabs to see if a name exists if dd_mmm_yyyy
then if it does add the _x to your search and do it again until you cant
find dd_mmm_yyyy and then create the new sheet with that name and write the
query out to the new tab.

Paul

On Tue, 15 Aug 2023, 01:10 Darren - Active Billing, <
darren at activebilling.com.au> wrote:

> Hi All,
>
> Long time no post - Don't do much Access stuff these days, but I have a
> Not-For-Profit pro-bono job (Rewriting something from 15 years ago)
>
>
> The Situiation:
>
> I have some queries that need to be output to excel. I managed to get that
> bit to work.
>
> And the process I have adds the Column header names - So that’s cool - And
> the Naming of the file and the naming of the Worksheet tab all works ok.
>
> So that all works OK for one query, outputting to one Excel File, with one
> Worksheet (one tab)
>
>
> The Question:
>
> But…there is a need to add tab, after tab, after tab, named by date
> (dd_MMM_yyyy) of essentially the same data/queries.
>
> (Users want to see their incremental changes organised by date named tabs)
>
> So…what I really need is to be able to output the results of a query to a
> known/existing Excel file, but in a new worksheet (new tab) and to be able
> to name this new tab as I do so.
>
>
> Nice to have:
>
> And if possible is it possible to see if a TAB name of the dd_MMM_yyyy
> exists and then just append the new tab with something like dd_MMM_yyyy_x
>
> (though that request above is not essential as I can just add a time
> component to the name to solve that issue)
>
> Make sense?
>
> Many thanks in advance, team
>
> Darren
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list