Creating an xls in Access 2010 VBA not working
Posted on 2014-11-30
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!