タイトル : VBでExcelに線を引きたい 投稿日 : 2008/05/09(Fri) 14:59 投稿者 : kaz
下記の情報を拝見してエディタに貼り付けましたが、mso〜に全て下波線で「宣言されていません」とでます。 Microsoft Excel 10.0 ObjectLibraryは参照しています。 環境はOS WinXP VB2008 EXCEL2002です。他に参照が必要なのでしょうか? Dim xlApp As Excel.Application '転載禁止 Dim xlBook As Excel.Workbook '転載禁止 Dim xlSheet As Excel.Worksheet '転載禁止 Dim xlShape As Excel.Shape xlApp = CreateObject("Excel.Application") xlBook = xlApp.Workbooks.Add xlSheet = xlBook.Worksheets(1) xlApp.Visible = True xlShape = xlSheet.Shapes.AddShape(msoShapeRectangle, 412, 138, 146.25, 45.75) With xlShape .Line.Weight = 6 .Line.DashStyle = msoLineSolid .Line.Style = msoLineSingle .Line.Transparency = 0.0# .Line.Visible = msoTrue End With xlShape = Nothing xlSheet = Nothing xlBook = Nothing xlApp = Nothing |