run macro in another excel in onedrive

New Contributor

how can I make a macro in excel A and save it in onedrive, and I share another excel (B)  which runs this macro ( in excel A), other person who shares with excel B and can use excel B with the macro,  but can not find this macro or edit it.

2 Replies


Here is some information and options

1) Copy a macro module to another workbook


2) Call VBA macro in external workbook

Sub MakroCalling()
Application.Run "External_Book.xlsm!TestProzedur"
End Sub


3) Execute code when activating & exiting an Excel workbook & worksheet


These are some information and possibilities that could lead you to your goal.


If you find this helpful, please mark it as "Best Answer" and as Like (click thumbs up), it will be beneficial to more Community members reading here.



I know I don't know anything (Socrates)





the option 2 below is very useful, but I wonder could you please advise

  1. how can I load the external excel in onedrive?  we have to refer the excel with path like D:external folder if excel is at D:external folder, but how can we refer the folder in onedrive?
  2. another thing is how can we hind the External_Book.xlsm even though other persons need to run the micro in External_Book.xlsm