Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

issue with read password-protected excel file using R

rayJ
8 - Asteroid

Hi,

 

I am trying to read in a password protected excel file using R function.

 

There's a solution online that works until it tries to read in excel cell formatted as Date or Time. Then it returns an error : `Error: R (1): There was an error in WriteYXDBStreaming` 
Anyone had similar issue before?

 

Thanks in advance!

 

Code in R: 

 

library("excel.link")

df <- read.Alteryx("#1", mode="data.frame")


filename <- as.character(df[1,"FullPath"])
excel_pwd <- as.character(df[1,"excel_password"])

 

excel_data <- xl.read.file(filename, xl.sheet = "sheet1", password = excel_pwd, write.res.password=excel_pwd)

write.Alteryx (as.data.frame(excel_data), 1)

 

1 REPLY 1
danilang
19 - Altair
19 - Altair

Hi @rayJ 

 

The error occurs because excel_data doesn't contain the correct metadata to the directly output it to Alteryx.

Replace your write.Alteryx line with these  

 

output <- lapply(excel_data, as.character)

output <- as.data.frame(output)

write.Alteryx(output, 1)

 

Dan

Labels
Top Solution Authors