We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

how to select cell that is active when workbook is opened

Thread ID:

Created:

Updated:

Platform:

Replies:

91125 Nov 4,2009 05:17 PM Nov 9,2009 01:38 AM ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Brian Schinazi
Asked On November 4, 2009 05:17 PM

Hi,

If I create a new workbook with ExcelEngine.Excel.Workbooks.Add() and then save it, how can I control which cell will be active when the file is opened in Excel?

Thanks,

Brian

Geetha M [Syncfusion]
Replied On November 6, 2009 05:35 AM

Hi Brian,

Thank you for your interest in Syncfusion products.

You may activate any cell using IRange as shown in the code snippet below.

sheet["B2"].Activate();

Please try this and let me know if you have any questions.

Regards,
Geetha

Brian Schinazi
Replied On November 6, 2009 09:10 AM

Hello Geetha,

I am getting a NullReferenceException when I try to make use of IRange.Activate().

This code is producing the exception for me:

ExcelEngine engine = new ExcelEngine();
IWorkbook workbook = engine.Excel.Workbooks.Add();
IWorksheet worksheet = workbook.Worksheets[0];
worksheet["B2"].Activate();
workbook.SaveAs(@"C:\testactivate.xls");

Calling the Activate() method in the fourth line raises the exception.

Thanks,

Brian



Geetha M [Syncfusion]
Replied On November 9, 2009 01:38 AM

Hi Brian,

Thank you for the details.

I am afraid that I am not able to reproduce this problem in our latest public release v7.4.0.15. You may get it from the forum thread linked below:

http://www.syncfusion.com/support/forums/general/91019/

Could you please make sure if you are using the above version and if you still see the problem, please send us the input file so that we could check and get back to you?

Regards,
Geetha

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;