1 Reply Latest reply: Aug 6, 2012 9:11 AM by Peter Lawlor RSS

    Help needed as Marco no longer works

    Peter Lawlor

      I have moved from QV8.5 to QV11 and the macro below now fails

      Any help as to why?

       

       

      Sub RunMe()

      Call exportToExcel("hsplit_zS_NCT","path x y z... \Automated report\NewCo_Trial_hsplit_export.xls")

      end sub

      sub exportToExcel(objectId, filePath)
      dim o
      Set o = ActiveDocument.GetSheetObject(objectId)
      o.ExportBiff filePath
      Set o = nothing

      f_name = filePath     
      Set oXL=CreateObject("Excel.Application")     
      Set oWB=oXL.Workbooks.Open(f_name)   
      Set oSH=oWB.Worksheets.Item(1)   
      'oSH.Cells(3,1) = ActiveDocument.Variables("vSelectedOrders").GetContent.String           
      oWB.Save    
      oWB.Close          
      Set oSH=nothing    
      Set oWB=nothing    
      Set oXL=nothing

      end sub