0

I am trying to edit the First Page Number in Page Setup in Excel Via R

library(RDCOMClient)
xlApp <- COMCreate("Excel.Application")
xlApp[["Visible"]] <- TRUE
xlBook <- xlApp[["Workbooks"]]$Add()
xlSheet <- xlBook[["Worksheets"]]$Item(1)
xlSheet$PageSetup()$FirstPageNumber() <- 1

Error in xlSheet$PageSetup()$FirstPageNumber() <- 1 : invalid (NULL) left side of assignment

Mohamed
  • 95
  • 7

1 Answers1

0
x <- xlSheet[["PageSetup"]]
x[["FirstPageNumber"]] <- 1
Mohamed
  • 95
  • 7