Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Text box export in excel export (very urgent)

hi,

I have a situation in macro,i need to export a text box from my report to excel. I am able to export multibox,tables but not text box.

Plz help me with it???

8 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

Hi,

Try the attach application.

Deepak

RSvebeck
Specialist
Specialist

Hi. Just did an example of this. See attached file. //Robert

Svebeck Consulting AB
Not applicable
Author

Hi,

Cud u plz tell me the syntax cz i am using the personal edition of qlikview.

RSvebeck
Specialist
Specialist

Hi.
Here is the macros used:

sub ExportExcel()
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = true
Set xlDoc = xlApp.Workbooks.Add()
Set xlSheet = xlDoc.Worksheets.Add
xlSheet.Name = "SheetFromExcel"
xlSheet.Range("A1").Value = getVariable("vButtonText")
xlSheet.Range("A2").Value = getVariable("vTextBoxText")
Set SheetObj = ActiveDocument.GetSheetObject("myChart")
SheetObj.CopyTableToClipboard true
xlSheet.Paste xlSheet.Range("A10")
End sub

function getVariable(varName)
set v = ActiveDocument.Variables(varName)
getVariable = v.GetContent.String
end function



Svebeck Consulting AB
Not applicable
Author

thnx Robert

Not applicable
Author

Hi Robert

There is one more thing,how can the size of the text in the text box be increased when exporting it to the excel??

RSvebeck
Specialist
Specialist

Do you mean once the text is in excel?

In that case:

add  the line

xlSheet.Columns("A:A").EntireColumn.AutoFit

after the line

xlSheet.Range("A2").Value = getVariable("vTextBoxText")

//Robert

Svebeck Consulting AB
RSvebeck
Specialist
Specialist

this is a good list of examples that you may find useful:

http://www.activexperts.com/activmonitor/windowsmanagement/scripts/msoffice/excel/

/Robert

Svebeck Consulting AB