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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.