Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Using Macro to export to Excel converts my text to numbers! Need Text!

Send to Excel I get this which is what I want:

852111581301575510575246314

Using Macro I get this:

8.52111581301575E+26

how do I get the macro to force it to text?

1 Reply
chematos
Valued Contributor II

Re: Using Macro to export to Excel converts my text to numbers! Need Text!

If you have that number in a TextObject you could use this:

Set z = ActiveDocument.GetSheetObject("TXyourtextID")

  z.CopyTextToClipboard

  wrksht.Range("A1").Select

  wrksht.paste

Or you could set a variable with your value and the use this at the macro to get the value as String:

varValue = ActiveDocument.Variables("yourVariableWithTheValue").GetContent.String

There are a few ways to do it, just try or search "convert to string vbs" in google

Hope this helps, regards

Community Browser