Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Did you study the famous texts by Andew Pitonyak? You can get them here.

Based on what I learnd mainly from this source:

Sub PasteClipboard
    Dim NoArg(4) As New com.sun.star.beans.PropertyValue
theDoc       = ThisComponent
myDispH      = createUnoService("com.sun.star.frame.DispatchHelper")
theCtrl      = theDoc.CurrentController
theSelection = theCtrl.GetSelection()
If NOT theSelection.SupportsService("com.sun.star.sheet.SheetCellRange") Then
    Exit Sub
End If
myDispH.executeDispatch(theCtrl, ".uno:Paste", "", 0, NoArg())
End Sub

Pasting something you do not know in detail in advance may b dangerous in different ways.

Did you study the famous texts by Andew Pitonyak? You can get them here.

Based on what I learnd mainly from this source:

Sub PasteClipboard
    Dim NoArg(4) noArg(4) As New com.sun.star.beans.PropertyValue
theDoc       = ThisComponent
myDispH      = createUnoService("com.sun.star.frame.DispatchHelper")
theCtrl      = theDoc.CurrentController
theSelection = theCtrl.GetSelection()
If NOT theSelection.SupportsService("com.sun.star.sheet.SheetCellRange") Then
    Exit Sub
End If
myDispH.executeDispatch(theCtrl, ".uno:Paste", "", 0, NoArg())
noArg())
End Sub

Pasting something you do not know in detail in advance may b dangerous in different ways.

Did you study the famous texts by Andew Pitonyak? You can get them here.

Based on what I learnd mainly from this source:

Sub PasteClipboard
    Dim noArg(4) As New com.sun.star.beans.PropertyValue
theDoc       = ThisComponent
myDispH      = createUnoService("com.sun.star.frame.DispatchHelper")
theCtrl      = theDoc.CurrentController
theSelection = theCtrl.GetSelection()
If NOT theSelection.SupportsService("com.sun.star.sheet.SheetCellRange") Then
    Exit Sub
End If
myDispH.executeDispatch(theCtrl, ".uno:Paste", "", 0, noArg())
End Sub

Pasting something you do not know in detail in advance may b dangerous in different ways.ways.

Editing with respect to the comments:
Here my test document. Just pasted a few cell contents in there using the Sub.