SSブログ

シートをアクティブにする LibreOffice Calc Basic [LibreOffice Calc Basic]

シートをアクティブにする LibreOffice Calc Basic

Sub sheetActive()
    'シートをアクティブにする
   
    Dim oSheetName As String
    Dim oSheet As Object
    '
        oSheetName="Sheet3"
        oSheet=ThisComponent.getSheets().getbyName(oSheetName)

    'シートをアクティブに
        ThisComponent.getCurrentController().setActiveSheet(oSheet)

    'A1に5000
        oSheet.getCellByPosition(0,0).value=5000

End Sub

一行にまとめると 、、、

ThisComponent.getCurrentController().setActiveSheet(ThisComponent.getSheets().getbyName("Sheet3"))

追記

Sheet選択をIndex()で・・・

Sub sheetActive2
'Sheet名ではなくIndexで・・・番号はゼロから・・・
    Dim oSheet as Object
        'getByIndex()でsheet2をセット
            oSheet=ThisComponent.getSheets().getByIndex(1) 'Sheet2
        'Index(1) Sheet2をアクティブにする
            ThisComponent.getCurrentController().setActiveSheet(oSheet)

End Sub

 

アクティブにしたシートのセルA1を選択する

Sub sheetActive3()

'Sheet名ではなくIndexで・・・番号はゼロから・・・
    Dim oSheet as Object
    Dim oCell as Object
   
        'getByIndex()でsheet2をセット
            oSheet=ThisComponent.getSheets().getByIndex(1) 'Sheet2
        'Index(1) Sheet2をアクティブにする
            ThisComponent.getCurrentController().setActiveSheet(oSheet)
        'Cell(0,0) Range("A1") を選択   
            oCell=ThisComponent.getCurrentController().getActiveSheet.getCellByPosition(0,0)
            ThisComponent.getCurrentController().Select(oCell)
           
End Sub

 

 


nice!(0)  コメント(2)  トラックバック(0) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 2

Janinsessy

Algodones <a href=https://viacialisns.com/#>generic 5mg cialis best price</a> Acheter Du Cialis En France <a href=https://viacialisns.com/#>Cialis</a> Propecia Vendo
by Janinsessy (2020-04-27 15:12) 

SWADWAY

Cialis E Simili https://agenericcialise.com/ - Generic Cialis Cialis Generico Dove Comprare <a href=https://agenericcialise.com/#>Generic Cialis</a> Can Amoxicillin Be Taken With Fluconazole
by SWADWAY (2020-06-17 17:39) 

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 0


Linuxランキング

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。