Nbconvert to notebook and execute on command line fails to load macro by name

I am executing a simple notebook on command line with macro using below command
jupyter nbconvert --to notebook --execute notebook_with_macro.ipynb

UsageError: Unknown variable ‘macro_name’

macro with ‘macro_name’ is defined and stored in a different notebook.I load the macro before trying to execute using
%store -r macro_name