0 Replies Latest reply: Mar 24, 2014 4:48 AM by Qliker Max RSS

    Conditional Running of Macro Based on Filename

      Hi Guys,

      QVW filename : expenses.qvw

       

      Sub ExportExcel()

        Call ExportToExcel("tblExpenses","c:\expenses.xls")

      End Sub

       

      Sub exportToExcel(objectId, filePath)

        Dim O

        Set O = ActiveDocument.GetSheetObject(objectId)

        O.ExportBiff filePath

        Set O = Nothing

      End Sub

       

      I'm calling this macro upon successful reload, is there a way for me to run this only when the filename is = expenses2014.qvw?

      Since the filename is expenses.qvw even i call the macro it should just end without executing any command.

       

      Thanks