The SaveAs method of the Workbook class failed

0
Const xlShiftDown = -4121

'Arquivo de entrada

strInput = WScript.Arguments(0)

'Arquivo excel

strOutput = WScript.Arguments(1)

'Arquivo excel

strFormato = WScript.Arguments(2)


Set objExcel = CreateObject("Excel.Application")

objExcel.DisplayAlerts = FALSE

objExcel.Visible = FALSE


Set objWorkbook = objExcel.Workbooks.Open(strInput)

Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Columns("BL:BM").Delete
objWorksheet.Columns("AP:BA").Delete
objWorksheet.Columns("AM:AN").Delete
objWorksheet.Columns("AK:AK").Delete
objWorksheet.Columns("O:AI").Delete
objWorksheet.Columns("B:F").Delete

objExcel.ActiveWorkbook.SaveAs strOutput, strFormato

objExcel.ActiveWorkbook.Close

objExcel.Application.Quit

Call the method below:

cscript S:\j\users\sclytr\filtroTabelaExtratoHotel.vbs "S:\j\users\sclytr\tabelas_extrato_hotel41e896290e48a7b16677ac4770b50a.xls" "S:\j\users\sclytr\tabelas_texto\tabelas_extrato_hotel.txt"  20

Error message below:

  

S: \ j \ users \ sclytr \ filterExtratoHotel.vbs (34, 1) Microsoft Excel:   The SaveAs method of the Workbook class failed

    
asked by anonymous 16.02.2018 / 15:23

0 answers