简体   繁体   中英

Share macros modules between excel and word

Over the last two years I have written several macros for excel and word and saving them in normal.dotm and personal.xlsm. I have some modules that handles filereading,database interactions, html parsing and so on, these modules are exact the same both in word and excel. Untill now I have just copied them between those two applications. Is it possible to somehow have them stored in one locations(as a library) and then use them in both applications?

I guess it could be possible to write a module that export it to a given location and then deletes them for so import them again to make sure that I remember to copy all modules between those two, but this seems like the wrong way to do it.

Store the common functions in a vbs file and load them from macros. Of course you may require to revisit the functions to make sure they do not have excel or word specific code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM