run macro in another excel in onedrive

Copper 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

@ericaukland 

Here is some information and options

1) Copy a macro module to another workbook

https://support.microsoft.com/en-gb/office/copy-a-macro-module-to-another-workbook-13c0938b-8432-425...

 

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

https://sites.google.com/a/erhard-rainer.com/erhard-rainer/computer/blog/excel-vbacodeausfuehrenbeim...

 

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.

 

Nikolino

I know I don't know anything (Socrates)

 

@NikolinoDE 

 

Thanks,

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