Trying to copy a range of data into a variable location and transpose the information from columns to rows. I keep receiving paste special method of range class failed. Line 15 Char 1.
New to VBScript and any help would be great!
set xl = CreateObject("Excel.Application")
xl.Application.DisplayAlerts=False
const xlDown = -4121
const xlUp = -4162
const xlPasteValues = -4163
set wb = xl.WorkBooks.open("https://Sharepoint address/SummaryKPI.xlsx")
WScript.Sleep 1000
If wb.WorkSheets("DataHistoryTurns").Range("A75536").End(xlUp).Value2 < Date Then
wb.LockServerFile
WScript.Sleep 100
wb.WorkSheets("Dashboard").Range("B2:B7").Copy
wb.WorkSheets("DataHistoryInv").Range("A75536").End(xlUp).Offset(1,1).PasteSpecial xlPasteValues,,,True
wb.WorkSheets("DataHistoryInv").Range("A75536").End(xlUp).Offset(1,0).value = Date
wb.WorkSheets("Dashboard").Range("E2:B8").Copy
wb.WorkSheets("DataHistoryTurns").Range("A75536").End(xlUp).Offset(1,1).PasteSpecial xlPasteValues,,,True
wb.WorkSheets("DataHistoryTurns").Range("A75536").End(xlUp).Offset(1,0).value = Date
wb.Save
End If
wb.Close
xl.Application.DisplayAlerts=True
xl.Quit