10-02-2012 10:25 AM
That's good news. I'm glad I was able to help you figure it out.
It is always fun when you can figure out the tricks to combine the power of LabVIEW programming with the power of ActiveX programming to be able to get some sophisticated programming tasks working.
12-25-2012 05:29 AM
Dear all,
You can use the workbook Invoke method: ExportAsFixedFormat, and as the type of the file select "xlTypePDF" as you can see in the .png attached..
Enjoy,
Yogev.
07-08-2020 10:13 PM
Hi,
Is there any way to save specific worksheet in separate PDF ? now its working and entire excel file will save in one PDF but I need to save different different worksheet in separate PDF.
can you please help.
Regards,
Vinay
07-09-2020 02:08 AM
Hi Vinay,
@Vinaygowda wrote:
Is there any way to save specific worksheet in separate PDF ? now its working and entire excel file will save in one PDF but I need to save different different worksheet in separate PDF.
So you already know how to print "entire" Excel files into PDFs!?
Then your problem reduces to move the worksheets you want to print into their own Excel workbook. In Excel this is usually done by right-clicking the worksheet tab and "copy/move" the worksheet…
07-09-2020 04:10 AM
What happens if you execute the ExportAsFixedFormat() method of a worksheet, rather than the workbook?
07-09-2020 07:50 AM - edited 07-09-2020 07:52 AM
Rolfk,
To answer your question, I don't know as I have never tried it (and not the OP).
For things like this, I just use the Record Macro feature, do what I want, and then port the generated VBA code over to LabVIEW ActiveX, with some light massaging. From the Developer - Code - Record Macro ribbon (Excel 365), I get this in a Module window:
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"Your_File_Path\Your_PDF_File.pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
Just plug those in a ActiveX Method/Property (some might be the defaults so the OP should reference the MSDN site) and it should work.
07-09-2020 09:16 PM
Hello GredW,
Thanks for your replay,
I found solution to my problem where we exporting excel file as PDF format. And if we want to get specific worksheet of excel file we need to mention which sheet we need in PDF. so for trail i converted excel to PDF and I chosen particular sheet in PDF by wiring sheet numbers as shown in picture below.
so I get the particular sheet in PDF
Thank you,
Vinay
07-10-2020 07:08 AM
Glad you found a solution.
One suggestion, I see you have the 6th page selected and hard coded. You might want to dynamically find that page and pass that parameter in to that function assuming it moves.
07-10-2020 07:16 AM - edited 07-10-2020 07:20 AM
Not bad but the Worksheet refnum should also support this method. The "ActiveSheet" reference in the recorded Visual Basic macro that RavensFan and later Eric posted definitely references a worksheet object and not the entire workbook object.
So if you have the reference to the worksheet in question you should be able to directly export that without the need to export fixed page offsets from the entire workbook.