here is the excel file. I am trying to print only the named range called formattedTable
Adhirath Excel Doc.zip (25.9 KB)
here is the excel file. I am trying to print only the named range called formattedTable
Adhirath Excel Doc.zip (25.9 KB)
The other content is from the other sheet “Sheet2”, please use the following code to hide all the worksheets except the worksheet where the specified range is in.
Workbook workbook ...
//hide all the sheet except the range sheet.
range.Worksheet.IsVisible = true;
foreach (Worksheet sheet in workbook.Worksheets)
{
if(sheet.Index != range.Worksheet.Index)
{
sheet.IsVisible = false;
}
}
DocxSaveOptions saveOptions = new DocxSaveOptions();
workbook.Save(“C:\my\path\Adhirath Excel Doc.Docx”, saveOptions);
that helped, but I’m still getting an extra blank page in my word document. Can I do something about that ?
You may set the printable area for the worksheet in MS Excel manually and then take the print preview of the sheet in MS Excel to check that blank page is also displayed or not. Moreover, could you please share your sample (runnable) code using Aspose.Cells for .NET with resource files (please zip the files prior attaching here). We will check and assist you to accomplish the task for your requirements.
code-
Hi, this is the code I am using. For some reason other tables and charts are also showing up in the created document.
Workbook workbook = new Workbook(“C:\my\path\Adhirath Excel Doc.xlsx”);
Aspose.Cells.Range range = workbook.Worksheets.Names[RangeName].GetRange();
range.Worksheet.IsVisible = true;
foreach (Worksheet sheet in workbook.Worksheets)
{
if(sheet.Index != range.Worksheet.Index)
{
sheet.IsVisible = false;
}
}
Aspose.Cells.PageSetup pageSetup = range.Worksheet.PageSetup;
pageSetup.PrintArea = range.RefersTo;
DocxSaveOptions saveOptions = new DocxSaveOptions();
workbook.Save(“C:\my\path\Adhirath Excel Doc.Docx”, saveOptions);
I am trying to get only the range called foramttedTable, it ends up providing me an extra blank page when converted to doc.
Adhirath Excel Doc.zip (26.1 KB)
@Adhirath
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-57903
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi, so there is a range I manually created, it has borders and when i save the excel as docx, i am not getting those borders to show up. The print image look just fine when I open it in excel. what is the reason?
try 1 is the output, book1 is the source table
Book1.zip (11.9 KB)
Try1.zip (8.9 KB)
also recommend fixes so that I am able to replicate the table exactly the way it is in excel print page to my word document. Thanks!
@Adhirath
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSNET-57925
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@Adhirath
We are pleased to inform you that your issue (logged earlier as “CELLSNET-57903”) has been resolved. The fix/enhancement will be included in the next release (Aspose.Cells v25.3) scheduled for release first half of March (next month). You will be notified when the next version is published.
This is to inform you that your issue (logged earlier as “CELLSNET-57925” - Show Borders when converting Excel to DOCX) has been resolved. The fix/enhancement will be included in the next release (Aspose.Cells v25.3) scheduled for release first half of March (next month). You will be notified when the next version is published.
Thank you guys, amazing support !!
You’re welcome! Stay tuned—the next version is scheduled for release in the second week of March 2025.
looks great!
Thanks for your feedback.
We will keep you updated as soon as the new version is released.