1 Reply Latest reply: Sep 7, 2017 10:32 AM by Anil Babu Samineni RSS

    Macro use Field Value Selected

    Michele Pierobon

      Hi Qlikers,

      I would like to launch the following macro and use the field value selected inside this VB macro.

      My purpose is saving an Excel File with the month name selected from the user.

      MonthName is a field!!

       

      Sub SendReport

      ActiveDocument.Sheets("SH02").Activate 'edit the sheet

      'ActiveDocument.reload

      set objExcel=ActiveDocument.GetSheetObject("CH23") 'edit the sheet object

      filepath="\\......path..........\"& MonthName &".xls"   'edit the location of file

      objExcel.ExportBiff filepath

      ActiveDocument.GetApplication.Sleep 5000

      End Sub


      Have you any idea??

       

      Thanks in advance!!!

        • Re: Macro use Field Value Selected
          Anil Babu Samineni

          I am not expert in This? But have a look

           

          Sub SendReport

          ActiveDocument.Sheets("SH02").Activate 'edit the sheet

          'ActiveDocument.reload

          set objExcel=ActiveDocument.GetSheetObject("CH23") 'edit the sheet object

          filepath="\\......path..........\"& SubField(Concat(MonthName, ','), ',', 1) &".xls"   'edit the location of file

          objExcel.ExportBiff filepath

          ActiveDocument.GetApplication.Sleep 5000

          End Sub