1

I am using VBA for Excel. My requirement is that the forms created in VBA shall communicate with external system over serial port of my system. For the same purpose, like we do in VB, I am tring to add MS Comm Control in VBA.

I am able to add MS Comm Control to control panel by selecting the same from Tools -> Additional Controls. However, when I try to place MSComm control on my form, it gives me following error.

The subject is not trusted for specified action.

Due to this, I am not able to place the control on my form and hence not able to use the same.

The same behaviour is observed for MS Winsock Control.

Found a similar question on stackoverflow: MSCOMM32.ocx usage causes Not Trusted Error without any concrete answer.

My installations are: Win XP - SP3, MS Office 2010, VB6, MS VS 2010.

Community
  • 1
  • 1
Jay
  • 1,210
  • 9
  • 28
  • 48
  • 1
    See if this help? http://www.vbforums.com/showthread.php?622730-MSCOMM-error-in-Excel-2007 – Siddharth Rout Nov 22 '12 at 13:55
  • This has solved the issue. Thanks a lot. – Jay Nov 22 '12 at 16:28
  • You've got an old version that has the killbit set: http://msmvps.com/blogs/access/archive/2009/06/14/an-older-version-of-mscomm32-ocx-has-had-the-quot-kill-bit-quot-flag-set.aspx – Hans Passant Nov 22 '12 at 16:30
  • @HansPassant Looks like I will have to try the solution that is suggested in this URL. Did not know that the flag is known as killbit flag and there are alternatives available. Will surely try this solution. Have you used it in past? – Jay Nov 22 '12 at 16:56

2 Answers2

0

Legal use of VB6 controls in an Excel macro (or in any 3rd party program or programming language) is restricted. The only exceptions are when you have licensed Office Developer Edition (or in newer versions of Office the extra developer package that contains VSTO or equivalent) or if you are just creating them for use on the same machine that has VB6 installed.

But your problem is probably either related to Microsoft kill-bitting the OCX (which prevents use in IE, and maybe in Office?), or more likely that you are using 64-bit Excel (and thus 64-bit VBA).

Bob77
  • 13,167
  • 1
  • 29
  • 37
  • My system is a 32-bit machine. – Jay Nov 23 '12 at 09:21
  • "Killbit is a security feature in web browsers based on Microsoft's Trident engine (such as Internet Explorer) and other ActiveX containers that respect the killbit (such as *Microsoft Office*)." https://en.wikipedia.org/wiki/Killbit – Bob77 Nov 23 '12 at 12:43
0

I got similar problem but with MsWinSck.OCX. I fixed it by loading ActiveX Compatibility Manager from http://www.nirsoft.net/utils/acm.html and enable the OCX (Winsck.OCX) by selecting the OCX in the lines then click the green LED on the menu.

Hope this may help.