You have created an "unskilled" link to an Excel application that cannot be freed using a global variable designed for VBA that should not be used in VB 6.0.
This is an unfortunate side effect of using VB 6.0, but it is the only problem that I know about using VB6, and it is easy to fix.
The problem in your case is related to the use of the global variable ActiveSheet. When using VBA, this is fine, but when using VB 6.0, you should avoid this or create an Excel application that you cannot free up. This approach will work fine the first time, but will cause all kinds of undefined behavior to appear the second time when your procedure starts.
In your example, the code should do something like this:
Sub Macro1() Dim xlApp As Excel.Application Set xlApp = New Excel.Application xlApp.ActiveSheet.OLEObjects.Add(ClassType:="test.test_control.1" _ , Link:=False, DisplayAsIcon:=False).Select ' Then when done: xlApp.Quit() xlApp = Nothing End Sub
For a detailed discussion of how to deal with this in general, see
VB 6.0 Tutorial - Finding and eliminating unqualified links ( http://www.xtremevbtalk.com/showthread.php?p=900556#post900556 )
For Microsoft documentation on this issue, see:
Excel Automation does not work in the second temporary code (MSKB 178510) ( http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q178/5 /10.asp )
Error or unexpected behavior when automating Office when using early binding in Visual Basic (MSKB 319832) ( http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q319832& )
Change Please note that the use of html 'a' tags for some reason did not work with these links. Someone may need to look into the parser?