InkPicture Control becomes disabled after being redrawn

scottadoyle

New Member
Joined
Oct 30, 2015
Messages
4
I dynamically create an InkPicture control in the following manner
Code:
    Set oObject = ActiveSheet.OLEObjects.Add(ClassType:="msinkaut.InkPicture.1", Link:=False, _            DisplayAsIcon:=False, Left:=myCell.Left, Top:=myCell.Top, _
            Width:=myCell.Width - 1, Height:=myCell.Height - 1)

After creating it and setting its properties such as InkEnabled = True I am able to add strokes (write on it). Once I scroll the control off the page then go back to it I am no longer able to add strokes. Before I scroll off the screen I can change the editingmode property from InkOverlayEditingMode.IOEM_Ink to InkOverlayEditingMode.IOEM_Delete or ...IOEM_Select. This allows me to change between being able to create new strokes, erase the existing strokes or select only but as mentioned earlier once I scroll the control off the screen or move to another sheet and come back I can no longer add ink even though the InkEnabled is set to true and editingmode is set to ...IOEM_Ink.

I am running Excel 2016. When ran in Excel 2010 it does not do this although in 2010 once I set InkEnabled to False I can no longer apply new ink even if I set InkEnabled back to true.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Does it work properly on a userform? Activex controls on worksheets have always been a little unreliable.
 
Upvote 0
Rory,

Thanks for the reply. I don't believe that using the control on a userform is going to be an option.
I am trying to create a workbook that has an audit trail sheet. Whenever the user changes a value in the workbook it will be recorded in the audit trail sheet and on that same row an InkPicture control is created to allow them to sign.

Any other suggestions are welcome.

I might try adding a double-click event to the control at creation that will check if the control has any ink and if not deletes the control and creates a new one in its place. So if the user fails to sign and afterwards is unable to sign they can double-click the control and a new one will be created for them.
 
Upvote 0
What you can do is copy the ink (from the userform) as a picture and then paste that onto the worksheet? The code is fairly simple:

Code:
    Me.InkPicture1.Ink.ClipboardCopyWithRectangle Me.InkPicture1.Ink.GetBoundingBox, ICF_Bitmap
    ActiveSheet.Paste
for example.
 
Upvote 0
Did you find the solution to this? I have same issue.


Rory,

Thanks for the reply. I don't believe that using the control on a userform is going to be an option.
I am trying to create a workbook that has an audit trail sheet. Whenever the user changes a value in the workbook it will be recorded in the audit trail sheet and on that same row an InkPicture control is created to allow them to sign.

Any other suggestions are welcome.

I might try adding a double-click event to the control at creation that will check if the control has any ink and if not deletes the control and creates a new one in its place. So if the user fails to sign and afterwards is unable to sign they can double-click the control and a new one will be created for them.
 
Upvote 0
Thanks alot man! . I placed in user form. Now trying to copy paste from the user form to sheet and the paste option is grayed put. What do I do?

I did what RoryA suggested. I put it in a user form and copied it from the user form to the worksheet then protected the sheet to prevent modification
 
Upvote 0
Thanks alot man! . I placed in user form. Now trying to copy paste from the user form to sheet and the paste option is grayed put. What do I do?
Are you using vba? Since you are referring to the paste option being greyed out I take it that you are trying to paste manually?


I copy the signature with the following code.
Me.InkPicture1.Ink.ClipboardCopyWithRectangle Me.InkPicture1.Ink.GetBoundingBox, 64

Then I select a cell on the sheet where I want to paste it and just paste.
myCell.Select
ActiveSheet.Paste
 
Upvote 0

Forum statistics

Threads
1,215,149
Messages
6,123,311
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top