excel - Error " 91" Object variable or With block variable not set -


hi guys totally new vba , i'm trying set value of cell 1 of function parameters. code giving error 91. 6th line in code raising error. i'm unable resolve , please can me .

thanks in advance.

sub report_file(a, r_row) dim wb_dst workbook dim ws_dst worksheet set wb_dst = workbooks.open("f:\projects\vba_excel\report.xlsx") ws_dst = wb_dst.sheets(1) ws_dst.cells(r_row, 2).value =a end sub 

the error line is.

ws_dst.cells(r_row, 2).value =a 

option explicit  sub report_file(a, r_row)     dim wb_dst workbook     dim ws_dst worksheet     set wb_dst = workbooks.open("f:\projects\vba_excel\report.xlsx")     set ws_dst = wb_dst.sheets(1)     ws_dst.cells(r_row, 2).value =     if = "savior"         wb_dst.cells(r_row, 2).value =     end if end sub 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -