0

I have completed a few fairly simple Excel & VBA projects but I am quite new to OLEObjects (noob!). After some research I have managed to place InkPicture on Excel worksheet ("Sheet1") using VBA (code below)

ActiveSheet.OLEObjects.Add(ClassType:="msinkaut.InkPicture.1", Link:=False, DisplayAsIcon:=False, Left:=ActiveCell.Left, Top:=ActiveCell.Top, Width:=240, Height:=70).Select

Does anyone know how to access the (embedded) InkPicture properties and methods using VBA?

Many thanks :)

user3520938
  • 5
  • 1
  • 4

1 Answers1

0

Try this

Dim yourObject As OLEObject
Set yourObject = ActiveSheet.OLEObjects.Add(ClassType:="msinkaut.InkPicture.1", Link:=False, DisplayAsIcon:=False, Left:=ActiveCell.Left, Top:=ActiveCell.Top, Width:=240, Height:=70)
PetLahev
  • 688
  • 3
  • 18
  • Many thanks! I can now reference it. Moreover, it behaves exactly as it should. Without declaring it as OLEObject it appeared on the sheet but had to be deselected to paint a stroke (it also only accepted single stroke). – user3520938 Apr 10 '14 at 21:18