Spire.XLS for .NET is a professional Excel .NET library that can be used to any type of .NET( C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Tue Nov 14, 2017 11:15 pm

Hi,
I would like to know how can I change the text of A1 cell from my already opened excel file.
I can see in the samples but it always uses Dim workbook As New Workbook()
Pls le me know

pwillard
 
Posts: 2
Joined: Tue Nov 14, 2017 7:09 am

Wed Nov 15, 2017 3:18 am

Hello,

Thanks for your inquiry.
You could load an existing workbook like below.
Code: Select all
            'Load Workbook
            Dim workbook As New Workbook()
            workbook.LoadFromFile("sample.xlsx")
            'Edit Text
            Dim sheet As Worksheet = workbook.Worksheets(0)
            sheet.Range("A1").Text = "E-iceblue"


Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Wed Nov 15, 2017 3:25 am

System.IO.IOException: 'The process cannot access the file 'C:\Users\Administrator\Desktop\test.xlsx' because it is being used by another process.'

I am getting this

pwillard
 
Posts: 2
Joined: Tue Nov 14, 2017 7:09 am

Wed Nov 15, 2017 3:51 am

Hello,

Thanks for your quick response.
Sorry it is not possible to edit the file when it is occupied by other processes.
You need to close the file first.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.XLS