Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

export to excel append file

Hi


i am trying export table into excel in qlikview .. i want one time file save and when later any changes occurred in table or any new record is add then want just update that excel file and also want headers .. not want to create whole new sheet again .. this is what i try


this code is doing every time new excel file


    sub ExcelExport 

    Set objExcel = CreateObject("Excel.Application") 

    objExcel.Visible = True 

    objExcel.DisplayAlerts = True 

    Set xlDoc = objExcel.Workbooks.Add 

    set obj = ActiveDocument.GetSheetObject("TB01") 

    obj.CopyTextToClipboard 

    objExcel.Range("A1").PasteSpecial 

    xlDoc.SaveAs "C:\Users\HP\Desktop\work\Test.xlsx" 

    

   

    Set xlSheet = xlDoc.Worksheets("Sheet1")   ' Replace Sheet1 with your sheet name 

    xlSheet.Activate 

    LastRow = xlSheet.Cells(xlSheet.Rows.Count, 1).End(xlUp).Row 

    msgbox LastRow 

    xlSheet.Cells(LastRow + 1, 1).Select 

    xlSheet.Paste

    objExcel.Visible = True 

    end sub

0 Replies