HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2013
0911
もるけっちょエクセルの編集2解決


もるけっちょ

リンク

2013/9/11(Wed) 21:08:36|NO.57087

HSP上からエクセル上の編集を行いたく質問致します。

① セルの幅/高さの変更

② エクセル上の文字フォントの変更

③ オブジェクトの書式変更(図形塗りつぶし色、枠線)
  


newcom xlApp, "Excel.Application" xlApp("visible") = 1 xlApp("displayalerts") = 0 xlBooks = xlApp("workbooks") xlBook = xlBooks("Add") xlSheet = xlBook("Worksheets","sheet1") Shapes= xlSheet("Shapes") Shapes -> "AddShape" 1, 80, 130, 40, 50 Shapes -> "AddShape" 1, 120, 130, 40, 50 Shapes -> "AddShape" 1, 160, 130, 40, 50 Shapes -> "AddShape" 1, 200, 130, 40, 50 xlSheet("Range","B1") = "←幅変更→" xlSheet("Range","B2") = "↑高さ変更↓" end



この記事に返信する


リンク

2013/9/11(Wed) 22:01:17|NO.57090

hspで質問のようなことまではやったことなかったですが、以下のようで出来るようです。
もっとシンプルな書き方があるかも知れません。

newcom xlApp, "Excel.Application"

xlApp("visible") = 1
xlApp("displayalerts") = 0
xlBooks = xlApp("workbooks")
xlBook = xlBooks("Add")
xlSheet = xlBook("Worksheets","sheet1")

Shapes= xlSheet("Shapes")

Shapes -> "AddShape" 1, 80, 130, 40, 50
Shapes -> "AddShape" 1, 120, 130, 40, 50
Shapes -> "AddShape" 1, 160, 130, 40, 50
Shapes -> "AddShape" 1, 200, 130, 40, 50

xlSheet("Range","B1") = "←幅変更→"
;--- 幅変更---
xlSheet = xlSheet("Range","B1")
xlSheet-> "Select"
xlSheet("ColumnWidth") = 20
;--- font変更---
xlSheet2=xlSheet("font")
xlSheet2("name")="HG正楷書体-PRO"

xlSheet("Range","B2") = "↑高さ変更↓"
;--- 高さ変更---
xlSheet = xlSheet("Range","B2")
xlSheet-> "Select"
xlSheet("RowHeight") = 128
;--- 塗りつぶし---
xlSheet2=xlSheet("Interior")
xlSheet2("ColorIndex")=5

end



もるけっちょ

リンク

2013/9/12(Thu) 11:56:43|NO.57100

有難うございました。
解決しました。



ONION software Copyright 1997-2025(c) All rights reserved.