run macro on auto open in personal workbook excel vba -


i trying run macro when sheet exported different stand alone program using. trying personal workbook apply workbooks opened can't figure out how object new sheet in code in personal workbook.

sub auto_open()  dim ans integer   activesheet.range("a1").select if instr(1, (activecell.value), "component") > 0     ans = msgbox("would run material requirements bom form macro?", vbyesno + vbquestion)     if ans = vbyes         matl_req_bom_form     else     end if else end if  end sub 

activesheet still returning object errors. have tried returning name of sheet , have not found success there either. rest of code work have use in more controlled setting, when export workbook , sub doesnt know name of workbook or sheet having trouble.


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -