ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert Character into Editing-Cell (https://www.excelbanter.com/excel-programming/334234-insert-character-into-editing-cell.html)

mj

Insert Character into Editing-Cell
 
I;d like to insert unicode character into a cell text which is on
cell-editing-mode
by outer application.
i tried to do it by "SendKeys" statement, but i failed.

How could i do that?

Thank you in advise.


Greg Wilson

Insert Character into Editing-Cell
 
You can paste from the Office Clipboard while in Edit Mode. You need to set a
Reference to the Microsoft Forms 2.0 Object Library. Suggested way to get a
character into the Office Clipboard:

Sub PutInClipboard()
Dim txt As New DataObject
txt.SetText Chr(128) ' change to desired character
txt.PutInClipboard
End Sub

While in Edit Mode, right-click to bring up the shortcut menu. Click the
Paste button. It will paste the character at the point in the edit.

Regards,
Greg


"MJ" wrote:

I;d like to insert unicode character into a cell text which is on
cell-editing-mode
by outer application.
i tried to do it by "SendKeys" statement, but i failed.

How could i do that?

Thank you in advise.


mj

Insert Character into Editing-Cell
 
Greg, thank you very much for your advise.
i understand what u say and can get character in clipboard.

However, another problem occured.
....i couldn't send key-code by statement "SendKeys("^V")"
to its parent application.( Sorry to say late , but i'm using Vb.net )

Hnd = CLng(Me.ObjAppOrg.Hwnd)
Ret = SetActiveWindow(Hnd) ' Set Excel-window Foreground by API.
System.Windows.Forms.SendKeys.Send("^V") ' Send clipboard contents.

# Should i make another thread?

Thanks.

"Greg Wilson" wrote:

You can paste from the Office Clipboard while in Edit Mode. You need to set a
Reference to the Microsoft Forms 2.0 Object Library. Suggested way to get a
character into the Office Clipboard:

Sub PutInClipboard()
Dim txt As New DataObject
txt.SetText Chr(128) ' change to desired character
txt.PutInClipboard
End Sub

While in Edit Mode, right-click to bring up the shortcut menu. Click the
Paste button. It will paste the character at the point in the edit.

Regards,
Greg


"MJ" wrote:

I;d like to insert unicode character into a cell text which is on
cell-editing-mode
by outer application.
i tried to do it by "SendKeys" statement, but i failed.

How could i do that?

Thank you in advise.



All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com