How to call sheet-specific macro from one Excel workbook in another?

后端 未结 4 1701
野的像风
野的像风 2021-01-05 01:53

I\'m trying to call an Excel macro that\'s in another workbook. It\'s a sheet-specific macro, but the syntax given by Microsoft documentation and researching on the web, on

4条回答
  •  爱一瞬间的悲伤
    2021-01-05 02:22

    can you adjust your macro to accept a sheetname as a parameter? Then when you call it within your original workbook's sheet you could just call it as MyMacro(me.name)? Then when you call it from your other workbook, you could just call it as application.run("testworkbook.xls!MyMacro","sheetname") where "sheetname" is your parameter.

    I'm not sure if there is any other way to do it.

提交回复
热议问题