タイトル : 修正し、解決しました 投稿日 : 2005/05/05(Thu) 09:37 投稿者 : 匿名希望
[OSのVer]:Windows [VBのVer]:VB.NET > > >'下記を有効にするとプロセスが残る > >objBorders(Excel.XlBordersIndex.xlEdgeBottom).LineStyle = Excel.XlLineStyle.xlDash > > 上記の部分に開放漏れがある事が解っているのだから、開放するようにすればいいだけでは。 > > objBorders(Excel.XlBordersIndex.xlEdgeBottom) この部分を一旦変数に受ける > 都度開放してみる 等を試してみれば解るかと思いますよ。 > > 色々試して、どうしても解らなければ再度投稿して下さい。 > (でも、出来る限り自分で理解するようにしないと、毎回他人に頼る事になるかと・・・) ご指摘有難う御座いました 試行錯誤の上、下記に修正し、解決いたしました。 勉強不足で申し訳御座いませんでした。 Dim objBorder As Excel.Border '新しく変数をとる 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 objBorder = objBorders(Excel.XlBordersIndex.xlEdgeBottom) objBorder.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(objBorder) System.Runtime.InteropServices.Marshal.ReleaseComObject(objBorders) System.Runtime.InteropServices.Marshal.ReleaseComObject(objCells) |