I had a quick look at your code. The one difference I see is that your pscanData parameter in procedure TForm1.OnBarcodeEvent is declared as an OLEVariant. My code declares this as a WideString. This difference would cause the "Invalid variant type conversion" you are getting.