Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Bumping with more details. I've this piece of test code and I'm having problems because at the end the -wkInterligBook- wkbook doesn't unload with the -Set wkInterligBook = Nothing- command. Can someone help me? Code: -------------------- Sub Test() Dim sFullPathToInterligFile As String Dim sFullPathToFinalFile As String Dim wkInterligBook As Workbook Dim con As ADODB.Connection sFullPathToInterligFile = ThisWorkbook.Path & "\Test_File.xls" sFullPathToFinalFile = ThisWorkbook.Path & "\Test_File_Copy.xls" Set wkInterligBook = Workbooks.Open(sFullPathToInterligFile) wkInterligBook.Sheets(1).Copy wkInterligBook.Close Set wkInterligBook = Nothing Set wkInterligBook = ActiveWorkbook wkInterligBook.SaveAs sFullPathToFinalFile DBEngine.RegisterDatabase "MS Excel Database", _ "Microsoft Excel Driver (*.xls)", True, _ "DBQ=" & sFullPathToFinalFile & ";DESCRIOTION=ODBC para Excel" Set con = New ADODB.Connection con.Open "Data Source=MS Excel Database" con.CursorLocation = adUseClient ' (...) ' (...) ' (...) ' (...) ' (...) con.Close Set con = Nothing wkInterligBook.Save wkInterligBook.Close Set wkInterligBook = Nothing End Sub -------------------- The references are the following [image: http://i22.photobucket.com/albums/b3...eferences.jpg] and you need to have an (any) excel file name -Test_File.xls- in the running folder. -- pao_e_vinho ------------------------------------------------------------------------ pao_e_vinho's Profile: http://www.excelforum.com/member.php...o&userid=21360 View this thread: http://www.excelforum.com/showthread...hreadid=554625 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Update Cell in WKBook 1 From WkBook 2 | Excel Discussion (Misc queries) | |||
How do I make sure my Wkbook is accessible to users using earlier | Excel Discussion (Misc queries) | |||
How to link to a single wksheet in a wkbook that has comments | Excel Discussion (Misc queries) | |||
how do i create a dialog box to appear on opening an excel wkbook | Excel Discussion (Misc queries) | |||
Can changes to a worksheet be applied to all wksheets in wkbook? | Excel Worksheet Functions |