COMatePLUS....excel save as PDF

Just starting out? Need help? Post your questions and find answers here.
Deraman
User
User
Posts: 28
Joined: Thu Mar 10, 2016 8:00 am

COMatePLUS....excel save as PDF

Post by Deraman »

Dear, I need to save excel file as PDF. Do we have such option in ExcelFunktion/COMatePLUS?

following is powershell script which can do quite similar...

Code: Select all

$path = “F:\”
$xlFixedFormat = “Microsoft.Office.Interop.Excel.xlFixedFormatType” -as [type]
$excelFiles = Get-ChildItem -Path $path -include *.xlsx -recurse
$objExcel = New-Object -ComObject excel.application
$objExcel.visible = $false
foreach($wb in $excelFiles)
{
 $filepath = Join-Path -Path $path -ChildPath ($wb.BaseName + “.pdf”)
 $workbook = $objExcel.workbooks.open($wb.fullname, 3)
 $workbook.Saved = $true
“saving $filepath”
 $workbook.ExportAsFixedFormat($xlFixedFormat::xlTypePDF, $filepath)
 $objExcel.Workbooks.close()
}
$objExcel.Quit()
I also found in ExcelConstantsPlus

Code: Select all

;--#xlFixedFormatType
#xlTypePDF = 0
#xlTypeXPS = 0