This code is going to work only if the SourceRange is selected on the Excel sheet, otherwise it will give an error.Add the 1 line code in bold to get it working and make sure there are values in the excel sheet.source_range = sheet.Range(SourceRange)...
Code
Dim xl, wb, ws, r, i, f as object
Try
  xl = GetInstance(Handle)
   if Workbook_Name = "" then
    wb = xl.activeworkbook
  else
     wb = xl.workbooks(Workbook_Name)
      wb.activate
  end if
   ws =...