When we need automation we use to write macro code in excel. Instead of writing the VBA codes
can we write R code within Excel. ?
I tried searching in google but couldn't found material upon it.
When we need automation we use to write macro code in excel. Instead of writing the VBA codes
can we write R code within Excel. ?
I tried searching in google but couldn't found material upon it.
Yes, you will have to pass by VB Script but you can do it by following these steps:
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.DisplayAlerts=False
Set wb = objExcel.Workbooks.Open("C:\Users\Deepanshu\Documents\example.xlsx")
Set Xlsheet = wb.Worksheets("PRDSALE")
Xlsheet.UsedRange.Borders.LineStyle = xlContinuous
Xlsheet.UsedRange.Borders.Color = RGB(0, 0, 0)
Xlsheet.UsedRange.Borders.Weight = xlThick
wb.save
pathofvbscript = "C:\\Users\\Deepanshu\\Documents\\border.vbs"
shell(shQuote(normalizePath(pathofvbscript)), "cscript", flag = "//nologo")