I have created a macro that opens a excel workbook and performs some operations and then at the end it closes the file.The macro is running fine.
Now, when I open my VBA Project explorer in the vba editor. It shows the list of files that have been opened by the macro even though they are closed. How do i remove them from the project explorer window ? why its still showing the excel workbooks, which are already closed ? is there anyway to fix it or its a limitation?
This workbook has lost its VBA project, ActiveX controls and any other programmability-related features. During the installation of Microsoft Office 2007, "Visual Basic for Applications" was not installed. To solve this you need to change your installation of Microsoft Office. Close all Microsoft Applications.
I found the answer myself.
Dim Excel_workbook As Excel.Workbook
Set Excel_workbook = Workbooks.Open("somefile name");
' some code goes here
' at the end write the below statement
Set Excel_workbook = Nothing 'worked, I found at the 12 page of google search
This is the link that helped me http://www.mrexcel.com/forum/showthread.php?t=50086
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With