投稿日 | : 2007/03/25(Sun) 03:54 |
投稿者 | : ちび |
Eメール | : |
URL | : |
タイトル | : どうしてでしょう? |
いつも、参考にさせていただいております。
プログラムをはじめたばかりでどうしたらよいいのかわかりません。
直す方法を教えてください、よろしくお願いいたします。
excelを操作してタイトルになる項目の結合して・線と色を付けたいのですが、
下記のselect文に入るとアプリケーションエラー・オブジェクト定義エラーとでて、
デバックが中断されてしまいます。
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Dim xlCells As Excel.Range
・
・
この間にexcelは起動し、項目の表示することはできたのですが・・・・
・
intTitle = 38
For i = 1 To intTitle
Select Case i
Case 1 To 10
xlCells(Cells(1, i), Cells(2, i)).MergeCells = True
xlCells(Cells(1, i), Cells(2, i)).Interior.Color = QBColor(34)
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeTop).LineStyle = xlGray75
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeLeft).LineStyle = xlGray75
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeRight).LineStyle = xlGray75
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeBottom).LineStyle = xlDouble
Case Else
xlCells(Cells(1, i), Cells(2, i)).Interior.Color = QBColor(34)
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeTop).LineStyle = xlGray75
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeLeft).LineStyle = xlGray75
xlCells(Cells(1, i), Cells(2, i)).Borders(xlEdgeRight).LineStyle = xlGray75
xlCells(1, i).Borders(xlEdgeBottom).LineStyle = xlGray75
xlCells(2, i).Borders(xlEdgeBottom).LineStyle = xlDouble
End Select
Next i