Hi All the EXCEL Experts!
I have written an extensive Macro that grabs a lot of data from an Excel file and uploads this data to a SQL SERVER 2008 Database. It works perfectly in the document where I created this marco originally, BUT I also need this to work on other Excel documents as well, without having to copy/paste the Macro code into each Workbook.
At our office, we create Excel reports for large construction projects. Each project has such an Excel report, that essentially outlines specific costs for specific types of services. Each such Excel report has (more or less) the same overall structure, which makes it possible for me to run this one macro I wrote on each document (it already dynamically grabs the data it needs for the SQL DB).
These Excel files (currently version 2007) are stored on a file server accesible to all financial staff members over the company internal network. I want the to be able to let each staff member open such an excel file, click a button (on the quick access toolbar) that runs my macro and then they can save and close this file and move on to the next one...
Can this be done? If so, how would I go about it? I know it needs to be declared as a Public Sub/Function, which I have already done. Initially I thought if I fire the Macro from a button on the QuickAccess toolbar it would work, but it keeps referring to the original file every time. How do I get this macro to work globally?
Looking forward to any assistance!!