1

I am trying to manipulate an Excel file (.xls) in R through RDCOMClient Package.

I created an Excel object in R, opened a workbook saved as .xls file format, and tried to convert the file format into .xlsx without pop-up dialog box when there is an Excel file with the same file name. Codes as below.

excel <- COMCreate("Excel.Application")
wb    <- excel$Workbooks()$Open(Filename = "filepath.xls",Password = "xxxxx")

excel$DisplayAlerts(FALSE)

wb$SaveAs(Filename = "filepath.xlsx" ,FileFormat = 51,Password = "")

I got an error message when I executed the code:

excel$DisplayAlerts(FALSE)

<'checkErrorInfo'> 8002000E Error: invalid number of parameter.

Community
  • 1
  • 1

1 Answers1

0

You should replace it with the following:

excel[["DisplayAlerts"]]=FALSE
Stephen King
  • 581
  • 5
  • 18
  • 31