エラーメッセージ

  • Deprecated function: Array and string offset access syntax with curly braces is deprecated in include_once() (line 20 of /home/users/0/ciao.jp-rpa/web/includes/file.phar.inc).
  • Deprecated function: Function create_function() is deprecated GeSHi->_optimize_regexp_list_tokens_to_string() (/home/users/0/ciao.jp-rpa/web/sites/all/libraries/geshi/geshi.php ファイル 4698行).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters drupal_get_feeds() (/home/users/0/ciao.jp-rpa/web/includes/common.inc ファイル 394行).

UiPath Snippet - Excelのセル名を取得する

引数(Arguments)の設定は画像を参照してください。

nColumn、nRowが入力値です。

注意:DataTable等との整合性のため、nColumn、nRowは「0が起点」になります。
セル「A1」は「nColumn = 0、nRow = 0」ですので、必要に応じて数値を加減してください。

 

Source Code: 
If nRow < 0 OrElse nRow > 1048575 _
    OrElse nColumn < 0 OrElse nColumn > 16383 Then Throw New ArgumentOutOfRangeException
 
Dim a As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
CellName = vbNullString
 
If nColumn > 701 Then
    nColumn = nColumn - 702
    CellName = a.Substring(Decimal.ToInt32(Math.Floor(CType(nColumn, Decimal) / 676)), 1)
    CellName = CellName + a.Substring(Decimal.ToInt32(Math.Floor(CType(nColumn / 26, Decimal) Mod 26)), 1)
ElseIf nColumn > 25 Then
    nColumn = nColumn - 26
    CellName = a.Substring(Decimal.ToInt32(Math.Floor(CType(nColumn, Decimal) / 26)), 1)
Else
    nColumn = nColumn
End If
 
CellName = CellName + a.Substring(nColumn Mod 26, 1) + (nRow + 1).ToString().Trim()