excel - Call PERSONAL macro from other workbook -
i working on macro receive data other file shared template. after user runs macro within shared workbook, update workbook. want make accessible possible.
i don't want users open template , update manually. that's not point. works fine. when call macro developer -> macros -> run, data copied template correct, , update works too.
but when set shortcut in developer -> macros -> options , call macro shortcut others workbooks not personal, macro stops in middle after opening shared workbook. , doesn't update data other workbooks.
am missing here guys? ideas?
edit:
my code:
public sub kpi() application.screenupdating = false kpi = "c:\kpi template.xlsx" workbooks.open (kpi) '****** <--- macro stops here - no error patht = "c:\" filenn = "kpi" filepath = dir(patht) while true if instr(1, filepath, filenn) > 0 goto resume1 end if filepath = dir wend resume1: workbooks.open (patht & filepath), readonly:=true kpi_filename = dir(kpi) r = 8 k = 2 lday = day(date) sh_name = workbooks(kpi_filename).sheets("check").cells(r, 2) while workbooks(kpi_filename).sheets("check").cells(r, 2) <> "" while workbooks(filepath).sheets(sh_name).cells(lday + 7, k) <> "" workbooks(kpi_filename).sheets("check").cells(r, k + 1) = workbooks(filepath).sheets(sh_name).cells(lday + 7, k) k = k + 1 loop r = r + 2 k = 2 sh_name = workbooks(kpi_filename).sheets("check").cells(r, 2) loop end sub
Comments
Post a Comment