Characters.Insert Method (Excel) limits text to 255 characters

前端 未结 3 1686
情书的邮戳
情书的邮戳 2021-01-13 00:15

It is really impossible to append more than 255 chars into a single cell by VBA macro in MS Excel?

Sample code:

Option Explicit
Sub TestSub()
  Dim L         


        
3条回答
  •  北海茫月
    2021-01-13 00:31

    I think that this is due to Excel. Mr. Microsoft : "If you use a Microsoft Visual Basic for Applications procedure to pass a string that is greater than 255 characters in length to an object, such as a text box, Microsoft Excel may truncate the string to 255 characters or may fail to enter the string in the text box. "

    Even though you are not passing a more than 255 characters string, I think this is related

    https://support.microsoft.com/en-us/kb/213841

    They offer a workaround on that support page.

提交回复
热议问题