![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | convert xls to pdf Hi guys, I have to make script to convert xls to pdf files and I'd like to know if this is possible with powershell. Thanks very much Andrew |
My System Specs![]() |
| | #2 (permalink) |
| | Re: convert xls to pdf mm..I don't sure that it is possible to convert comething to PDF without any additional software. However I recomend CutePDF Writer which installs as printer and any file in any program that support printing - you can easy convert any file to PDF. -- WBR, Vadims Podans MVP: PowerShell PowerShell blog - www.sysadmins.lv "Andrea" <netsecurity@xxxxxx> rakstija zinojuma "news:1d5393bf-047b-47d1-a1b8-a14ddbfc573b@xxxxxx"... Quote: > Hi guys, > I have to make script to convert xls to pdf files and I'd like to know > if this is possible with powershell. > > Thanks very much > Andrew |
My System Specs![]() |
| | #3 (permalink) |
| | Re: convert xls to pdf You can export Excel workbooks to Fixed Format -PDF or XPS- with _Office 2007_ (the ExportAsFixedFormat Method was added to Office 2007) and the free Add-In you can download here: http://r.office.microsoft.com/r/rlidMSAddinPDFXPS Then, simply create an instance of Excel, open the workbook you want to export and export it: # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # -<Sample.ps1>- $ExcelFile = 'C:\Excel\file.xls' $Destination = 'C:\file.pdf' # Microsoft.Office.Interop.Excel.XlFixedFormatType $xlTypePDF = 0 $xlTypeXPS = 1 # Microsoft.Office.Interop.Excel.XlFixedFormatQuality $xlQualityStandard = 0 $xlQualityMinimum = 1 $readOnly = $true $save = $false $xl = new-object -c excel.application # open workbook read-only $wb = $xl.workbooks.Open($ExcelFile,$null,$readOnly) $XlFixedFormatType = $xlTypePDF $XlFixedFormatQuality = $xlQualityStandard # export to PDF fixed format $wb.ExportAsFixedFormat($XlFixedFormatType, $Destination,` $XlFixedFormatQuality) # close workbook without saving $wb.close($save) # cleanup $xl.quit() $xl, $wb | % { [void][Runtime.InteropServices.Marshal]::releaseComObject($_) } -- Robert |
My System Specs![]() |
| | #4 (permalink) |
| | Re: convert xls to pdf Whew. Glad you posted; I was still working on my realllly complicated explanation of installing fake GhostScript drivers and automating print output. : ) "Robert Robelo" <Kiron@xxxxxx> wrote in message news:OHb5eYtuJHA.1300@xxxxxx Quote: > You can export Excel workbooks to Fixed Format -PDF or XPS- with _Office > 2007_ (the ExportAsFixedFormat Method was added to Office 2007) and the > free Add-In you can download here: > http://r.office.microsoft.com/r/rlidMSAddinPDFXPS > > Then, simply create an instance of Excel, open the workbook you want to > export and export it: > > # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # > # -<Sample.ps1>- > $ExcelFile = 'C:\Excel\file.xls' > $Destination = 'C:\file.pdf' > > # Microsoft.Office.Interop.Excel.XlFixedFormatType > $xlTypePDF = 0 > $xlTypeXPS = 1 > > # Microsoft.Office.Interop.Excel.XlFixedFormatQuality > $xlQualityStandard = 0 > $xlQualityMinimum = 1 > > $readOnly = $true > $save = $false > > $xl = new-object -c excel.application > > # open workbook read-only > $wb = $xl.workbooks.Open($ExcelFile,$null,$readOnly) > > $XlFixedFormatType = $xlTypePDF > $XlFixedFormatQuality = $xlQualityStandard > > # export to PDF fixed format > $wb.ExportAsFixedFormat($XlFixedFormatType, $Destination,` > $XlFixedFormatQuality) > > # close workbook without saving > $wb.close($save) > > # cleanup > $xl.quit() > $xl, $wb | % { > [void][Runtime.InteropServices.Marshal]::releaseComObject($_) > } > > -- > Robert |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Convert .Swf to .Exe | General Discussion | |||
| Vb6 Convert | .NET General | |||
| convert vhs to Dvd | Chillout Room | |||
| RE: Convert VHD to ISO? | Virtual PC | |||
| Convert EML to DBX? | Vista mail | |||