Ask Your Question

Copy String from Calc Cell [Solved] [closed]

asked 2015-12-21 02:07:20 +0100

macroman gravatar image

Hi there,

I seem to be having trouble copying a string from a calc cell. Every time I try to paste the copied information into a writer doc, it pastes the entire cell rather than just the text. Here is a code snippet, all terms have been defined and Frame and Frame2 are the Writer doc and Calc doc respectively.

InfoCell = CalcDoc.Sheets(2).getCellbyPosition(2, 3)
Info = InfoCell.String
dispatcher.executeDispatch(Frame2, ".uno:Copy", "", 0, Array())
dispatcher.executeDispatch(Frame, ".uno:Paste", "", 0, Array())
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-12 02:52:43.733072

1 Answer

Sort by » oldest newest most voted

answered 2015-12-21 02:06:41 +0100

macroman gravatar image
Frame = WriterDoc.CurrentController.Frame
Frame2 = CalcDoc.CurrentController.Frame

  dim args1(0) as new
  args1(0).Name = "ToPoint"
  args1(0).Value = "$C$4"
  dispatcher.executeDispatch(Frame2, ".uno:GoToCell", "", 0, args1())
  dispatcher.executeDispatch(Frame2, ".uno:Copy", "", 0, Array())

  dim args2(0) as new
  args2(0).Name = "SelectedFormat"
  args2(0).Value = 10
  dispatcher.executeDispatch(Frame, ".uno:ClipboardFormatItems", "", 0, args2())
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-12-21 01:32:23 +0100

Seen: 207 times

Last updated: Dec 21 '15