Is there a limit on an Excel worksheet's name length?

后端 未结 5 946
天命终不由人
天命终不由人 2020-12-03 06:26

When I try to set a longish worksheet name using ruby and win32ole with the following code:

require \"win32ole\"
excel = WIN32OLE.new(\'Excel.Application\')
         


        
5条回答
  •  独厮守ぢ
    2020-12-03 06:51

    I just tested a couple paths using Excel 2013 on on Windows 7. I found the overall pathname limit to be 213 and the basename length to be 186. At least the error dialog for exceeding basename length is clear: basename error

    And trying to move a not-too-long basename to a too-long-pathname is also very clear:

    The pathname error is deceptive, though. Quite unhelpful:

    This is a lazy Microsoft restriction. There's no good reason for these arbitrary length limits, but in the end, it’s a real bug in the error dialog.

提交回复
热议问题