Topics Search


Views: 73
Can you specify a sheet name in the DoCmd.OutputTo command when trying to export multiple reports to multiple sheets in the same excel file? If yes, what is the syntax?
Sponsored Links:

Similar posts...


DoCmd.OutputTo AcFormatPDF

DoCmd.OutputTo AcFormatPDF Icon
I'm trying to use DoCmd.OutputTo to save a report as a PDF file. The trouble I'm having is that it seems to ignore the formatting set in VBA. In this case if a certain condition is true thePageHeader is hidden, the problem is that DoCmd.OutputTo prints that header even if the condition is true.

Is there a way around it? Am I missing something?

outputto challenge

outputto challenge Icon
In VBA I'm trying to export 2 reports of my dbase as snapshots to a folder where users have access to.

The code I use:

DoCmd.OutputTo acOutputReport, "whatever", acFormatSNP, "T:\whatever.snp"
DoCmd.OutputTo acOutputReport, "whatever_1", acFormatSNP, "T:\whatever_1.snp"

The problem is that the second outputto never runs.
It only executes the first one, not the second.

However when I put this code in a button script it does work.

My problem is that I do not want to press a button to achieve this, the reports should automatically be saved as snapshots each time the dbase is run.

Has anyone have the same problem with docmd.outputto.&gt

docmd.outputto messages

docmd.outputto messages Icon
Has anyone had any success suppressing the "now outputting" dialog boxes you get with docmd.outputto

I have got close, but the best I can do is to flick up what looks like an empty dialog box, which immediately disappears.

from 2005! is there any way to do this that can be incorporated into VBA?

docmd.transferspreadsheet crashes access

docmd.transferspreadsheet crashes access Icon
I am having some trouble with the docmd.transferspreadsheet function, everytime I run it, it crashes Access. I have used the docmd.outputto function and that works fine but I need the queries to be in the same excel file but in different sheet and the docmd.outputto open a new excel file for each query.


I have tried to display an error message but Access just freezes and I get the program not responding message |

Creating PDFs with Docmd.OutputTo

Creating PDFs with Docmd.OutputTo Icon
When printing reports directly to PDFs using "Docmd.OutputTo" some lines (inside graphics) appear dashed. When the report is opened and printed to Adobe PDF or when the report is queued directly to a printer, the lines are not dashed.

(I even tried opening the report first and then using the option within "Docmd.OutputTo" to print the active object, but tono avail.)

Attached is an image of two graphics- the left image does not show any dashed effect, while the right one does. The effect is much more pronounced when printed.

Supressing .pdf creation in acOutputTo

Supressing .pdf creation in acOutputTo Icon
I am using VBA in Access 2007 and have the following code on a button in a stand alone form (form isn't tied to any data);

DoCmd.OutputTo acOutputReport, "rpt25+Anes", acFormatPDF, "Z:\Erx\Anes25+.pdf", False
DoCmd.OutputTo acOutputReport, "rpt25+Barb", acFormatPDF, "Z:\Erx\Barb25+.pdf", False
DoCmd.OutputTo acOutputReport, "rpt25+CUH", acFormatPDF, "Z:\Erx\CUH25+.pdf", False

The code works fine, the problem is that the second report, "rpt25+Barb" doesn't have any data yet. So I wind up creating a .pdf for my admin to send out that is empty. I create these reports every month.

Down the road that second report will have some data at some point and so I want to have that report ready to go when that does happen.

Now is there a way to check to see if the second report has data and if not, jump to the next OutputTo? If the second report does have data, follow thorough with the OutputTo command.

I have tried playing with HasData property,

OutputTo Action vs Method

OutputTo Action vs Method Icon
I have to create an Excel spreadsheet from an Access table using a macro. The filename is constructed from textbox values in a form. In a custom function, I use DoCmd.OutputTo and specify acFormatXLS as the OutputFormat. But the resultant spreadsheet is an older version of Excel. I need the Excel 97-2003 format. This can be specified in the OutputTo action, but not in the method. Is there a way to generate the correct version

OutputTo: Report to Excel gives "The format in which you are attempting..."

OutputTo: Report to Excel gives "The format in which you are attempting..." Icon
OS: Windows XP SP3, Office 2007 Enterprise with SP2 (12.0.6557.50001) SP2 MSO(12.0.6544.5001). When using DoCmd.OutputTo and attempting to output a report to Excel, I get the following error:

The format to which you are attempting to output the current object is not available.

1) DoCmd.OutputTo acOutputReport, strSource, acFormatXLSX, , False
where strSource is the name of the report.

Researching the error seems to indicate that outputting a report to Excel will only work if SP2 is installed, but I do have SP2 installed.

VBA to export pivot table as export to excel option

VBA to export pivot table as export to excel option Icon
Is there vba code to obtain the same result that “Export to Excel” button on ribbon/toolbar access menu? I tried to use DoCmd.OutputTo command but only data refer to recordsource control was export in excel file. I mean there is a difference between the action that the "Export to Excel" execute from the action that execute the use of DoCmd.OutPutTo

DoCmd.OutputTo acOutputReport

DoCmd.OutputTo acOutputReport Icon
How come I'm prompted to specify the output file type when the following code is executed?

DoCmd.OutputTo acOutputReport, "PDF-DirNames", acFormatPDF, IPPath & "\PDF-DirNames.PDF", True

It might be that the code is compiled into an A2003 mde file but executed in an A2007 environment?