Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.

R Tool to Read from a password protected XLSM Macro Enabled File

7 - Meteor

I was successful in using the R TOol Code below to read ffrom an XLSX file that was password protected WITHOUT the red parameter below.


Researching (

I have found that the file.format parameter is optional, and when NOT present it defaults to file.format = xl.constants$xlOpenXMLWorkbook.  However, when I include that when reading an XLSX file, it does not work.


The problem I am trying to solve is using the code below to read from an XLSM file, but don't seem to be using the file.format parameter correctly.



install.packages(c(""),repos='',dependencies = TRUE)


df <- read.Alteryx("#1", mode="data.frame")
importfilename <- as.character(df[1,"FullPath"])
excel_pwd <- as.character(df[1,"excel_password"])
excel_sheet <- as.character(df[1,"Sheet_Name"])


excel_data <- = xl.constants$xlOpenXMLWorkbookMacroEnabled, importfilename, xl.sheet = excel_sheet, password = excel_pwd)

write.Alteryx(excel_data, 1)

9 - Comet

Hi @aaronindm,


As per documentation, argument file.format is only available for Using it with wil throw the following error:


Error in = xl.constants$xlOpenXMLWorkbookMacroEnabled, : 
unused argument (file.format = xl.constants$xlOpenXMLWorkbookMacroEnabled)





7 - Meteor

@PaulNo thank you - I was not sure if those arguments could/should be used in both read and write, but apparently it is just the write functions!


It does work now, sort of. 


I am still having issues with the R Tool import not accepting dates, but I have that in a separate thread here: