Free Support Forum - aspose.com

CurrentRegion property is not available for AsposeExcel.Worksheet

I want to find out CurrentRegion of a given excel cell. Sample code is something below if i use Microsoft interop dll's.

Application _excelApp = new Application();

Microsoft.Office.Interop.Excel.Workbook wb = _excelApp.Workbooks.Open(@"D:\Test\Test.xlsx",

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing, Type.Missing, Type.Missing,

Type.Missing, Type.Missing);

Microsoft.Office.Interop.Excel.Worksheet ws = wb.Sheets[1];

Range current = ws.Cells.Range["B4"].CurrentRegion;

object[,] valueArray = (object[,])current.get_Value(XlRangeValueDataType.xlRangeValueDefault);

Iam using Aspose cells to achive the same thing. I will give first data cell value some thing like 'B4', based on that i want the current region of the cells. i don't want other data in the sheet.

How can i achieve the same using Aspose? Is there any alternative for gettting same result?

sample code:

AsposeExcel.Workbook workbook = new AsposeExcel.Workbook(docStream);

AsposeExcel.Worksheet worksheet = workbook.Worksheets[0];

worksheet.Cells.Here i am not finding anything

For Aspose worksheet Cells i didn't see Range property as well.

Note: CurrentRegion is something like in Excel sheet select a cell value and press Shift + Ctrl + * that will select a particular region of data.

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and use the latest version:
Aspose.Cells
for .NET v7.3.3.2


Please try the Workbook.Settings.Region property and see if it fits your needs.

If it does not fulfill your needs, then please provide us your source xls/xlsx file, expected output and some screenshots explaining your feature in detail.

We will look into it and help you asap.

Hi,


I am not sure completely but as I can understand you are trying to get the selected value in a cell or specify/obtain the specific range of chars in the cell, well, you may use Cell.Characters API for this purpose, see the document for reference: http://www.aspose.com/docs/display/cellsnet/Formatting+Selected+Characters+in+a+Cell. Also for getting/setting the selected value/chars, as the actions demand the user interaction in WYSIWYG (visual) manner, so Aspose.Cells cannot perform this operation as Aspose.Cells is just a library that does have any interface.

If you need to perform the manipulation of data in the cells visually in grid like environment or control, we have another set of controls:
Aspose.Cells.GridDesktop --> grid control for desktop application
Aspose.Cells.GridWeb --> grid control for web forms
For more information, see the demos for GridWeb:
http://www.aspose.com/demos/.net-components/aspose.cells/csharp/grid/default.aspx

Let me know if I understand you correctly or you may give more details (as my fellow colleague asked you) about your issue.

Thank you.