2

I am using the following code to add web browser control to PowerPoint slide,

Set oShp = oSld.Shapes.AddOLEObject(Left:=100, Top:=100, Width:=200, Height:=300, Classname:="Shell.Explorer", Link:=msoFalse)

The above code works fine in all PowerPoint versions except PowerPoint 2013 (32bit and 64bit). I get the following error message,

enter image description here

In PowerPoint 2010 (32bit and 64bit) the web browser control is added but the control is black until viewing it in Slide Show. Then it gets refreshed.

How to fix this?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Codename K
  • 890
  • 4
  • 23
  • 52

1 Answers1

2

You are seeing the error because Web Browser Control are made obsolete in Office 2013 for security reasons.

There is a workaround HOWEVER, it will put your machines at risk of vulnerability attacks

http://support.microsoft.com/kb/2793374

securecodeninja
  • 2,497
  • 3
  • 16
  • 22
  • Thanks. This may be the issue. I'll go through this and get back to you. – Codename K Jan 01 '15 at 04:33
  • It works. But, I have one question: When the OLEObject Web Browser Control (opening PDF file) is added the shape becomes black. Do you know why? It becomes normal when view it in Slide View mode. – Codename K Jan 02 '15 at 13:08
  • I suppose that's how Shapes are colored by default. You can try adding the optional parameter DisplayAsIcon:=True, which displays the shape into an icon. Hope everything helped – securecodeninja Jan 02 '15 at 18:39
  • I hope I've earned your bounty :) – securecodeninja Jan 03 '15 at 01:31
  • Thanks for your help sop far. If given "DisplayAsIcon:=True" it always only shows the icon and not the content. Anyway thanks again. – Codename K Jan 03 '15 at 04:41