Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
chriswalz
Regular Visitor

custom R visual runtime error (access denied to local url)

Hi,

 

I have created a custom Power BI visual using this http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1 tutorial. I'm using Plotly to create a interactive chart in this visual.

I can use this custom visual without any problems in power BI desktop, but when I publish it to powerbi.com, I receive the following error "script runtime error":

Error in shell.exec(url) : access to 'C:\Users\Client\Temp\RtmpOsE2VBviewhtml1c717b3ce9/index.html' denied

Does anybody have an idea what's causing this error?

 

The following R code has been used to create the visual:

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############library(ggplot2)library(plotly)library(lubridate)
####################################################

################### Actual code ####################x <- data.frame(as.POSIXct(substr(Values$SendLocalTime,0,19),format = "%Y-%m-%dT%H:%M:%S"), as.numeric(as.character(sub(",", ".", Values$AvgBeltTemperature, fixed = TRUE))))colnames(x) <- c("Date", "Value")x <- data.frame(as.POSIXct(substr(Values$SendLocalTime,0,19),format = "%Y-%m-%dT%H:%M:%S"), 
                as.numeric(as.character(sub(",", ".", Values$AvgBeltTemperature, fixed = TRUE))),                as.numeric(as.character(sub(",", ".", Values$MinBeltTemperature, fixed = TRUE))),                as.numeric(as.character(sub(",", ".", Values$MaxBeltTemperature, fixed = TRUE))))colnames(x) <- c("Date", "Average","Minimum", "Maximum")

#Labels for axisf <- list(  family = "Arial, monospace",  size = 16,  color = "#7f7f7f"
)label_x <- list(  title = "Date",  titlefont = f)label_y <- list(  title = "Temperate (Celsius)",  titlefont = f)g<-plot_ly(x= ~x$Date, y = ~x$Average, type = 'scatter', name="Average", mode='markers') %>%  add_trace(x= ~x$Date, y = ~x$Minimum, name = 'Minimum', mode = 'markers') %>%  add_trace(x= ~x$Date, y = ~x$Maximum, name = 'Maximum', mode = 'markers') %>%  layout(title = "Temperature", xaxis = label_x, yaxis = label_y)

(gg <- ggplotly(g))internalSaveWidget(gg, 'out.html');
####################################################
1 ACCEPTED SOLUTION

I've received the solution from Microsoft support that worked for me.

 

Simply remove the plot_ly conversion in the end:

 

(gg <- ggplotly(g))

 

and use 'g' as input for internalsavewidget because 'g' is already a plot_ly object.

Not sure why this leads to an error in PowerBI service because converting a plot_ly object to a plot_ly object shouldn't be a issue.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

I experienced same issue. 

Does any one know the solution?

 

Thank you

Anonymous
Not applicable

Hi chriswalz,

 

I am having the same problem and the suggestion marked as the solution below does not work for me.

Did you have your problem fixed?

 

v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @chriswalz,

In your statement, you use source('./r_files/flatten_HTML.r') to cite other R statement, please use the detailed R in the .r file statement to replace the "source('./r_files/flatten_HTML.r')", and check if it works fine. And please follow this blog to check if there is unsupported packages in your .r file.

Best Regards,
Angelia

Hi @v-huizhn-msft,

 

thanks for your response - unfortunately they didn't solve this issue. Still getting the access denied runtime error. I also checked the packages but all packages i'm using are on the list of supported packages.

 

Best regards,

Chris

I experienced same issue. 

Does any one know the solution?

 

Thank you

I've received the solution from Microsoft support that worked for me.

 

Simply remove the plot_ly conversion in the end:

 

(gg <- ggplotly(g))

 

and use 'g' as input for internalsavewidget because 'g' is already a plot_ly object.

Not sure why this leads to an error in PowerBI service because converting a plot_ly object to a plot_ly object shouldn't be a issue.

I experienced same issue. 

Does any one know the solution?

 

Thank you

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors