Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Jul 15, 2019 11:18 am

Hi,

I use this code to add textbox to my excel sheet
Code: Select all
Dim tb1 As Core.ITextBox = sheet.TextBoxes.AddTextBox(row, col, h, w)


The textbox added is aligned to the left side of the cell. Is there a way to align the textbox to the centre of the cell?

ducphu
 
Posts: 11
Joined: Tue Nov 24, 2015 5:13 am

Tue Jul 16, 2019 8:23 am

Hello,

Thanks for your inquiry.
Since Spire.XLS is based on MS Excel, even using MS Excel, there is no direct way to to align the TextBox to the central of the cell. Sorry our Spire.XLS also doesn't have a good way to achieve it. If there is any other question, just feel free to write back.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.XLS