IkEcht
12-02-2008, 05:25 AM
Hi,
in my document loads of macrobuttons get replaced by text, taken from excel. A typical sub behind a macrobutton would look like this:
Sub oponthoudoordeel()
xl.Sheets("oponthoud").Select
xl.Range("b7").Select
xl.Selection.Copy
Selection.PasteSpecial DataType:=wdPasteText
End Sub
Where the cell pointed at contains a formula that returns a string. So as far as I understand, and most of the subs work fine, the resulting text-string of the formula in excel is copied.
No problem thus far but then again, in some cases the copied string is accompanied by spaces either in front or behind the string (or both). I can not yet link this behaviour to anything, nor in word nor in excel. Does anybody know about this problem and a solution?
Would be a great help as these spaces are a big bother indeed.
thanks!
in my document loads of macrobuttons get replaced by text, taken from excel. A typical sub behind a macrobutton would look like this:
Sub oponthoudoordeel()
xl.Sheets("oponthoud").Select
xl.Range("b7").Select
xl.Selection.Copy
Selection.PasteSpecial DataType:=wdPasteText
End Sub
Where the cell pointed at contains a formula that returns a string. So as far as I understand, and most of the subs work fine, the resulting text-string of the formula in excel is copied.
No problem thus far but then again, in some cases the copied string is accompanied by spaces either in front or behind the string (or both). I can not yet link this behaviour to anything, nor in word nor in excel. Does anybody know about this problem and a solution?
Would be a great help as these spaces are a big bother indeed.
thanks!