I initially used this code to upload a password-protected Excel spreadsheet into R. It worked completely fine and I was able to read the file.
library("readxl")
library("dplyr")
library("excel.link")
library("tinytex")
new_path = paste0(tempdir(), "\\", "Bone_Dataset_7-13-2022.xlsx")
xl()[["Activeworkbook"]]$saveas(new_path, AccessMode=xl.constants$xlExclusive)
###
xl()[["Activesheet"]]$Unprotect(password = "Password")
bonedata = crc[a1]
xl.workbook.close()
unlink(new_path) # remove temporary Excel File
BoneData <- bonedata
BoneData
However, I am trying to knit my r.markdown file, and the code no longer seems to be working. It uploads a file with only 1 row and one column in it (there should be ~1500 rows).
Description:df [1 × 1]
| |a |
| -----| --------------|
| 1 | NA |
What am I doing wrong here? Why did it work before, but not now??
Thank you so much!