アクティブなシートの名前を返します。
#Include <Excel.au3>
_ExcelSheetNameGet($oExcel)
パラメータ
| $oExcel | _ExcelBookOpen()か_ExcelBookNew()の呼び出しで開かれているExcelオブジェクト |
返し値
| 成功: | アクティブなシートの名前(文字列) |
| 失敗: | 0を返し@errorに値を設定します |
| @error: | 0 - 正常終了 |
| 1 - 指定されたオブジェクトが存在しません |
注意
なし。
関連
例
; ***************************************************************
; 例 1 - ワークブックを開きオブジェクト識別子取得後、アクティブなシートの名前を返す
; *****************************************************************
#include <Excel.au3>
Local $oExcel = _ExcelBookNew() ;新しいブックを作成して表示
MsgBox(0, "Sheet Name", "The Current Active Sheet Name Is:" & @CRLF & _ExcelSheetNameGet($oExcel))
MsgBox(0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, @TempDir & "\Temp.xls", "xls", 0, 1) ; 上書き設定でtempディレクトリに保存
_ExcelBookClose($oExcel) ; 閉じて終わり
; ***************************************************************
; 例 2 - ワークブックを開きオブジェクト識別子取得後、新しいシートを追加しアクティブなシートの名前を返す
; *****************************************************************
#include <Excel.au3>
Local $oExcel = _ExcelBookNew() ;新しいブックを作成して表示
MsgBox(0, "Sheet Name", "The Current Active Sheet Name Is:" & @CRLF & _ExcelSheetNameGet($oExcel))
_ExcelSheetAddNew($oExcel, "New Sheet Example") ;Add a New Sheet
MsgBox(0, "Sheet Name", "Now The Current Active Sheet Name Is:" & @CRLF & _ExcelSheetNameGet($oExcel))
MsgBox(0, "Exiting", "Press OK to Save File and Exit")
_ExcelBookSaveAs($oExcel, @TempDir & "\Temp.xls", "xls", 0, 1) ; 上書き設定でtempディレクトリに保存
_ExcelBookClose($oExcel) ; 閉じて終わり