Creating an xls in Access 2010 VBA not working REVISITED
Posted on 2014-12-01
I recently posted the question below and thought I had it working. I put the code recommended into the program but when I published it as an ade I got the format error again. When I run the adp the program works and it creates the xls file, but as an ade it does not. Is there something about ade's that prevent them from running this?
Thank you all again. Here is the original question:
I have an Access 2010 program that at one point allows the user to create an excel export file from the data (well originally I had the program creating a csv file). Someone is helping me update this program so it works cleaner and in conjunction with the cloud so they changed the code slightly. Now I get an error box that says "The format in which you are attempting to output the current object is not available"
Here is the original code that worked:
DoCmd.TransferText acExportDelim, "", "Export Plan Selection and Deduction To Send Sorted", "\\HOST33\ShareFile\CLIENTS\3CTRPS\Export for " & UCase(txtClientID.Value) & " Date-" & Replace(CStr(Date), "/", "-") & " Time-" & Replace(CStr(Time), ":", "-") & ".csv", True, ""
Here is the code that he created:
DoCmd.OutputTo acOutputReport, stdocname, acFormatXLSX, strFilename
(the variables produce the same name for the file as the first one does).
I tried changing it to read acFormatXLS also and it still did not work.
Any help is really appreciated!