Dim rg As MSExcel.Range = ws.Cells(ws.UsedRange.Rows.Count+1,1)
改成
Dim rg As MSExcel.Range = ws.Cells(1, ws.UsedRange.Columns.Count+1)