sunilvedula Posted May 15, 2009 Report Share Posted May 15, 2009 HI all, i want to trigger macro express when a key is pressed in ms-access database. i have developed a database in ms- access which multiple users use. Now when they complete a work they need to send an email to business are confirming the job is done with a formatted excel sheet to which a reply is sought from the business area who will attach some images and send it back to us. With access i am able to send mail but cannot format the excel sheet the way i want. i have designed a macro to do the desing part so that it goes to the mail and pastes the data in exce in rich text format so that the business are people can drop images beside the data and send it back to us. to make this possible i should be able to trigger the macro express but that i find it difficult. i can try opening the macro file with sql code but how do i make it trigger? can macro express self trigger once the file is opened? any ideas please put forward as i need to submit my presentation ASAP. BTW I USE MACRO EXPRESS 3.2 Quote Link to comment Share on other sites More sharing options...
kevin Posted May 15, 2009 Report Share Posted May 15, 2009 I have not used Access for a number of years. Here are the ways (non-Access specific) to activate a macro: 1. Create a hotkey activated macro, set the scope properties to Access, type the hotkey within Access. 2. I'm sure there is a way for Access to run an external program. Have it run 'meproc.exe /A<macro name>'. Meproc is found in the folder where your Macro Express Program files are installed. You will probably need to include the path: 'c:\Program Files\Macro Express 3\meproc.exe /A<macro name>' 3. Convert your macro to a playable macro and 'run' it like you would any other executable program (the same way you would run a program for step 2 but without using meproc.exe). Something like this execute 'd:\macros\mymacro.mxe'. 4. You may be able to use a Windows API call. There are examples available for Delphi, C/C++/Visual C, and VBA. Details for all these options are found in the Macro Activation area of the help file. You should consider upgrading to the latest version of Macro Express 3. There have been 585 changes to Macro Express 3 since v 3.2 was released. Many of these changes make Macro Express more stable. See the Revision History for details. The update is free for licensed Macro Express 3 users. Download the latest version from the Macro Express Download page. Quote Link to comment Share on other sites More sharing options...
rberq Posted May 15, 2009 Report Share Posted May 15, 2009 I use Kevin's method 2 with Visual Studio / Visual Basic. I inserted the commands in the "click" logic for the button which is supposed to trigger the macro. Quote Link to comment Share on other sites More sharing options...
sunilvedula Posted May 19, 2009 Author Report Share Posted May 19, 2009 Hi Kevin, Thank you for providing me with a list of options. Thanks a ton. The second option should work for me. will check and confirm the same. One quick question. How do we convert macro into playable one? Can you elobarate on that please. Because i have written the macro with activation of a title window. If you can let me know how to convert into playable one then i can trigger it with click of a button. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.