p.s. please note that I declare mylibraries when I reprex, also I take care to make it so my code can simply be copy and pasted and run
I hope this solution helps you, I think Shiny is great 
library(corrplot)
library(shiny)
library(tidyverse)
ui<-(
fluidPage(
navbarPage(
"Correlation Analysis",
tabPanel("Dataset",
sidebarPanel(
fileInput('file1', 'Choose Excel file (.xlsx):',
accept = c(".xlsx")
),
uiOutput("filterSelector")
),
h5("Column numer:"),
uiOutput("my_output_data"),
numericInput("valore1", label = h5("Start column:"),min = 1,value = 1),
numericInput("valore2", label = h5("End column:"),min = 1,value = 11),
textOutput("result"),
tableOutput("table1")
),
#####correlation
tabPanel("Correlation",
sidebarPanel(
h5("Correlation."),
actionButton("calculate_cor", label = "Calculate"),
),
mainPanel(
plotOutput('cor')
)
)
)
)
)
server <- (
function(input,output){
output$filterSelector <- renderUI({
div(
varSelectInput("filter_var",
"Filter Variable:",
req(tableData())),
selectizeInput("filter_vals",
"Filter Values:",
choices=NULL,
multiple = TRUE))
})
observe({
fv <- req(input$filter_var)
td <- req(tableData())
updateSelectizeInput(inputId = "filter_vals",
choices = pull(td,fv))
})
col_min <- reactive({
min = input$valore1
})
col_max <- reactive({
max = input$valore2
})
tableData <- reactive({
inFile <- input$file1
if (!is.null(inFile)){
read_excel(input$file1$datapath)
} else {
mtcars
}
})
filteredTableData <- reactive({
td <- req(tableData())
fv <- req(input$filter_var)
fc <- input$filter_vals
if (isTruthy(fc)) {
dplyr::filter(
td,
!!sym(fv) %in% fc
)
} else
td
})
output$table1 = renderTable(filteredTableData())
colonne <- reactive({
database <- filteredTableData()
data_size <- ncol(database)
returnValue(data_size)
})
output$my_output_data <- renderText({colonne()})
function(input, output) {
output$result <- renderText({
paste("You chose", input$state)
})
}
output$my_output_data <- renderText({colonne()})
###correlation
observeEvent(input$calculate_cor, {
intervall <- col_min():col_max()
df_data_cor<-filteredTableData()[intervall]
df_data_cor_scale<-cor(df_data_cor)
output$cor<-renderPlot({
corrplot(df_data_cor_scale,
method = "pie")
})
})
})
shinyApp(ui,server)