How to save an Excel sheet as PDF through MATLAB?
이전 댓글 표시
I am using the following code:
hExcel = actxserver('Excel.Application');
hWorkbook = hExcel.Workbooks.Open(sprintf('%s','C:\test.xlsx'));
hWorksheet = hWorkbook.Sheets.Item(1);
hRange = hWorksheet.Range('A1:O10');
hRange.ExportAsFixedFormat('xlTypePDF','test_out.pdf');
The Excel ActiveX server allows me to do the usual stuff, but the last line doesn't do anything. Neither does it throw any error.
Does anyone know how to do this?
댓글 수: 1
Praveen
2016년 12월 28일
hRange.ExportAsFixedFormat('xlTypePDF','test_out.pdf'); In this code give the path name, it works.. For example 'C:\test_out.pdf' instead of test
채택된 답변
추가 답변 (1개)
Intissar El Bouanani
2023년 8월 10일
0 개 추천
it is possible to print the selected field in one page
카테고리
도움말 센터 및 File Exchange에서 ActiveX에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!