タイトル : エクセルの罫線描画でプロセスが残る 投稿日 : 2005/05/04(Wed) 17:02 投稿者 : 匿名希望
[OSのVer]:Windows 2000 [VBのVer]:VB.NET 2003 いつも参考にさせて頂いています。 エクセルで、罫線描画をしているのですが、 プロセスが残ってしまいます。アドバイスの程、宜しくお願い致します。 罫線は上、下、横で線の太さを変更したいのです。 Dim objCells As Excel.Range Dim R1, R2 As Excel.Range Dim objRange As Excel.Range Dim objBorders As Excel.Borders objCells = xlsSheet.Cells R1 = DirectCast(objCells._Default(intSetRow, 1), Excel.Range) R2 = DirectCast(objCells._Default(intSetRow + intCnt, 16), Excel.Range) objRange = xlsSheet.Range(R1, R2) objBorders = objRange.Borders ' 下記を有効にすると、プロセスは残らない 'objBorders.LineStyle = Excel.XlLineStyle.xlContinuous '下記を有効にするとプロセスが残る objBorders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDash System.Runtime.InteropServices.Marshal.ReleaseComObject(R1) System.Runtime.InteropServices.Marshal.ReleaseComObject(R2) System.Runtime.InteropServices.Marshal.ReleaseComObject(objRange) System.Runtime.InteropServices.Marshal.ReleaseComObject(objBorders) System.Runtime.InteropServices.Marshal.ReleaseComObject(objCells) |