Hi
I'm developing an Excel VBA procedure and I need some support.
I believe I'm doing a very basic error...
WHAT AM I DOING?
I'm opening an excel workbook and link it to a workbook variable type,
then I'm copying a sheet to a new book and *trying* to link it to a new
workbook variable type
At the moment I can do this with the piece of code at the buttom, but I
believe that this is not the best way to do it.
WHY?
Because, this procedure is causing me some troubles at the end.
What happens in the last line of the code is that, besides I don't have
any error, at the end of the procedure the workbook stills open in the
memory and it should be deleted from the memory with the -Set ... =
nothing-.
Code:
--------------------
Set wkInterligBook = Workbooks.Open(sFullPathToInterligFile)
wkInterligBook.Sheets(sIcTID).Copy
wkInterligBook.Close
Set wkInterligBook = Nothing
Set wkInterligBook = ActiveWorkbook
wkInterligBook.SaveAs sFullPathToFinalFile
(...)
wkInterligBook.Save
wkInterligBook.Close
Set wkInterligBook = Nothing
--------------------
Can someone please point me to the right direction.
Many thanks.
P&V
--
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