require(tcltk) surface<-function(){ main=tktoplevel() get<-function() { source("surface_color.R") tkdestroy(main) } sub<-tkbutton(main,text="Browse",command=get) but.label<-tklabel(main,text="Choose Excel file to create Surface Model") tkgrid(but.label,sub,padx=10,pady=10) } surface()