Please post your sample code with template (input) file and output file here, we will check it soon. I have a doubt there might be some issue/minor error with your code, not sure though.
You gave us the generic code which looks fine to me.
Please post your template file, output file (after activation of cell in row/column in panes) by Aspose.Cells and your desired file (you can manually activate your desired cell(s) in rows/columns in panes).
The test file "aspose_test_sliding.xls" is attached. "aspose_test_sliding_selected.xls" is the result of the code execution. We expect the main area of the worksheet is scrolled, but in "aspose_test_sliding_selected.xls" the fixed rows in the top are scrolled instead.
Here's the sample code to reproduce the bug:
using System;
using Aspose.Cells;
namespace Test { public class Program { public static void Save(Workbook _workbook, string selectedSheetName, int selectedRow, int selectedColumn) { Worksheet activeSheet = _workbook.Worksheets[selectedSheetName]; _workbook.Worksheets.ActiveSheetIndex = activeSheet.Index; activeSheet.ActiveCell = activeSheet.Cells[selectedRow, selectedColumn].Name; activeSheet.FirstVisibleColumn = (selectedColumn > 15 ? selectedColumn - 3 : 0); activeSheet.FirstVisibleRow = (selectedRow > 15 ? selectedRow - 5 : selectedRow); _workbook.Save("aspose_test_sliding_selected.xls"); }
public static void Main(string[] args) { Workbook workbook = new Workbook("aspose_test_sliding.xls"); Save(workbook, "et trois", 300, 5);
I think you need to modify/update your code a bit, also you need to use PaneCollection API for your need as you have some frozen rows/columns in your desired sheet.
Here is my sample code, I have tested it with your template file, it works fine for your requirement now, so try it:
Aspose.Cells.License license = new Aspose.Cells.License(); license.SetLicense(@“E:\Licenses\new4\Aspose.Cells.lic”);
the only thing is that if i don't have panes, the collection is null. So i have to check in the code if there are panes and set the visible row and column in two ways like this
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.