Excel – MS Comm Control in VBA

excelserial-portvb6vba

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.

Best Answer

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).