3 Replies Latest reply: Dec 13, 2013 3:43 PM by Vamshi Tataipelli RSS

    Macro to export a flat file (.txt)

    Vamshi Tataipelli

      Hi, i have written a macro to export a .csv file ( a sheet object). And it worked well when i gave a OnPostReload trigger.

      But if i just change it to .txt, the file is forming but when i open the file with a notepad or wordpad the data is not clearly showing instead, it seems like irregular!.


      Will there be a solution for this! can i use that .txt file anymore!

        • Re: Macro to export a flat file (.txt)

          Hello Vamshi,


          I've used this macro to export some chart to QVD file. The follow macro export to QVD File open a Transform QVW file and Reload this QVW.


          I hope it helps you:


          SUB ExportarCarteraHistorica





            Respuesta = MsgBox ("Proceso de Generacion de Cartera, para continuar confirmar!!",308,"Alerta: GENERAR CALCULO !!")

            If Respuesta = 6 Then    

            Set App = ActiveDocument.GetApplication 

            Set obj1 = ActiveDocument.GetSheetObject("CH134")

            obj1.ExportEx "C:\QlikView\PRODUCCION\DATA\XLS\QVD\_Exp_Cartera_Historica_UltimoMes.qvd", 4



            Set obj2 = ActiveDocument.GetSheetObject("CH133")

            obj2.ExportEx "C:\QlikView\PRODUCCION\DATA\XLS\QVD\_Exp_UltimoMesGenerado_CH.qvd", 4


              Set T1_PptoHistorico = App.OpenDoc("C:\QlikView\PRODUCCION\TRANS\CuentasXCobrar\QVW\T1_Ppto_CHistorico.qvw") ' abrir Documento    

              T1_PptoHistorico.Reload ' Recargar Documento

              T1_PptoHistorico.Save ' Grabar Documento



              Set T1_PptoCbrzCalend = App.OpenDoc("C:\QlikView\PRODUCCION\TRANS\CuentasXCobrar\QVW\T2_Ppto_Cobranza_Calendario.qvw") ' abrir Documento    

              T1_PptoCbrzCalend.Reload ' Recargar Documento

              T1_PptoCbrzCalend.Save ' Grabar Documento




              Set T2_Cobranza = App.OpenDoc("C:\QlikView\PRODUCCION\TRANS\CuentasXCobrar\QVW\T2_Cobranza.qvw") ' abrir Documento    

              T2_Cobranza.Reload ' Recargar Documento

              T2_Cobranza.Save ' Grabar Documento




              Set T3_Cobranza = App.OpenDoc("C:\QlikView\PRODUCCION\TRANS\CuentasXCobrar\QVW\T3_Cobranza.qvw") ' abrir Documento    

              T3_Cobranza.Reload ' Recargar Documento

              T3_Cobranza.Save ' Grabar Documento







              MsgBox("Proceso concluido: Cartera Historica Generada")



            End If

          End Sub

          • Re: Macro to export a flat file (.txt)

            This is the jobs group not community!  Please use the community