[AccessD] Transfer Spreadsheet

Darryl Collins darryl at whittleconsulting.com.au
Mon Oct 8 04:49:52 CDT 2018


Yes, The "strDateToday" would be a chief suspect here.  You are likely better off using DATESERIAL to turn the date into something file name friendly such as YYYYMMDD (20181008 for example).

You might already be doing this, but if you could give us a debug.print of the export string as VBA see it, we are likely to find the issue on this one.

Cheers
Darryl.



-----Original Message-----
From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of accesspro at cox.net
Sent: Monday, 8 October 2018 3:30 PM
To: 'Access Developers discussion and problem solving' <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Transfer Spreadsheet

To be clear the method works, just not able to create a new excel file......

This Works as long as I have the excel file in the folder:
 'DoCmd.TransferSpreadsheet acExport, 10, "tblTimeCard", "C:\A-Best Systems\TimeOutput.xlsx", True

None of these will work. I guess because the file does not exist:
DoCmd.OutputTo acOutputQuery, "qryOutputOldLargeReorderDays", acFormatXLSX, "C:\A-Best Systems\TimeOutput " & strDateToday & " PayPeriod " & strJobPeriod & ".xlsx"
DoCmd.TransferSpreadsheet acExport, 10, "qryOutputOldLargeReorderDays", "C:\A-Best Systems\TimeOutput " & _
    strDateToday & " PayPeriod " & strJobPeriod & ".xlsx", True


tia

bob


-----Original Message-----
From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of Darryl Collins
Sent: Sunday, October 7, 2018 8:42 PM
To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Transfer Spreadsheet

Any chance you can post the relevant code segment? 

You should be able to do this seamlessly so curious to see what is going on.

Cheers
Darryl.



-----Original Message-----
From: AccessD <accessd-bounces at databaseadvisors.com> On Behalf Of accesspro at cox.net
Sent: Monday, 8 October 2018 2:11 PM
To: 'Access Developers discussion and problem solving'
<accessd at databaseadvisors.com>
Subject: [AccessD] Transfer Spreadsheet

I am using the transfer spreadsheet method and am able to successfully export my data.
What would be a bonus is for me to create a new excel file each time with a unique file name.
When I include such vba code, I get an error "Not a valid file name".
I want to NOT use my existing "template" excel file.
Maybe not possible with this method ??

TIA

Bob



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list