Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings.
I wrote the following subroutine to open, do some formatting, and then close a workbook prior to importing its data into my current workbook: Sub CleanSrc(src As String) Set srcApp = New Excel.Application srcApp.Visible = False Set srcWkBk = srcApp.Workbooks.Open(myFile) Set srcSht = srcWkBk.Sheets(1) srcLast = srcSht.Range("A1").End(xlDown).Row srcSht.Rows((srcLast + 1) & ":" & (srcLast + 5)).Delete srcWkBk.Close (True) Set srcWkBk = Nothing Set srcApp = Nothing End Sub My problem is that later when I attempt to import data from this workbook, I get complaints it being locked (by myself!) and read only. It appears that somehow this workbook is never really closed and/or the application I spun up wasn't exited properly. Can somebody please tell me what I can do to fix this problem? Regards, Charles |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Before close and workbook open! | Excel Programming | |||
How can I close only 1 workbook when I have many open? | Excel Discussion (Misc queries) | |||
Open, print and close workbook | Excel Programming | |||
Close Open Workbook | Excel Programming | |||
Close Open Workbook | Excel Programming |