6

There are a quite a few of sources to get a video stream from webcam into a picturebox embedded in a userform.

However, I am trying to do something a little neater, basically have a the preview of the video stream from webcam in a control that is embedded directly into the sheet rather than on a floating userform. I am not sure if this possible. I would very much appreciate any pointers.

Community
  • 1
  • 1
  • 2
    Sorry, not sure of how to do this but I did want to comment to whoever voted to close that the existing close vote (move to Serverfault) is invalid. This is not a Serverfault question. – squillman Oct 27 '15 at 19:41
  • 2
    With an own ActiveX/OLE Control, this should be possible. We have done so for IE 6 a long time ago (10+ years). I don't think it is possible with VBScript only. Btw: what to you mean with webcam? An USb-Webcam or an IP-Webcam? An IP-Webcam has just JPEG-Images you can show. – CPlusSharp Oct 28 '15 at 09:52
  • Well in my case it will be the internal camera of the computer, but I think this should equally work. with Excel you can insert an embedded Active X image control, but I am not sure it will work in this case. So basically what you are saying it requires a custom ActiveX control, that maybe beyond me at this stage. –  Oct 28 '15 at 15:56
  • A good idea to use Excel as a spreadsheet, not a database, not a full-blown EUCA, and certainly not as a replacement for Skype. A really important part of any Engineering field, particularly Software, is using the right tool for the job. While you could use a 15 year old ActiveX control to do it - you would be much better off using VSTO and embedding the video in a floating control. This idea has been discussed in the past, eg: https://www.google.com.au/webhp?q=embed%20video%20in%20excel%20cell - its just not good practice. – Jeremy Thompson Oct 31 '15 at 15:53
  • 1
    If you can write a .Net WinForm UserControl to view your video stream, then you should be able to produce a ActiveX UserControl that you can utilize in Excel. Get the [Microsoft InteropForms Toolkit 2.1 ](http://www.microsoft.com/en-us/download/details.aspx?id=3264). Even though it was originally intended to allow .Net UC usage in VB6, it works fine to write UCs for use in Excel. As a test, I just wrote one that used the Windows Media Player and it played the video fine as a UserControl on the worksheet. Start VS as an Admin as it needs to be able to register the control. – TnTinMn Nov 04 '15 at 05:14

2 Answers2

1

(Answer from TnTinMn's comment - Posting as an answer to remove from 'Unanswered' queue)

If you can write a .Net WinForm UserControl to view your video stream, then you should be able to produce a ActiveX UserControl that you can utilize in Excel.

Get the Microsoft InteropForms Toolkit 2.1 .

Even though it was originally intended to allow .Net UC usage in VB6, it works fine to write UCs for use in Excel.

As a test, I just wrote one that used the Windows Media Player and it played the video fine as a UserControl on the worksheet.

Start VS as an Admin as it needs to be able to register the control.

schizoid04
  • 888
  • 1
  • 11
  • 27
0

I would say build a Form with TopMost = True Then you can display your webcam video in this Form and put it anywhere you want.