Results 1 to 6 of 6

Running excel macro's from withing Access

  1. #1
    zippy483 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    24

    Running excel macro's from withing Access

    Hi all



    I'm looking for a method to run a set of macros in an existing excel spreadsheet, by clicking a button in Access.

    Here is the scenario I have some data in a spreadsheet that I run a macro on that macro opens another excel workbook and imports some data then I run a further macro on that data to enter data into another spread sheet, from there I click a button in Access that imports the data I require into the database.

    I know there is probably a much easier method to this but I have inherited the original spreadsheets and my employer wants to keep the method I'm looking for a way to automate it from Access

    I can run the first macro no problem, but how do i run the macro from the open book1 that completes the manipulation of the spreadsheet data

    I already have a solution for importing the data from the final spreadsheet

    so in short what i am lookin to do is

    Open Spreadsheet1 and run macro1 (I can do this)

    Run Macro2 from the spreadsheet that macro1 opens

    any ideas??

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    i have no idea, bud. But I would assume you'd have to open an excel app through vba, then run the macro from a sheet object that you set. i wouldn't see any other way possible.

  3. #3
    zippy483 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    24
    that is essentially what i have done to run the first macro, that's great

    but the first macro opens a second workbook (book1) that i need to run a second macro on tha is the part I'm having trouble with I'm probably being a little dim but I am reasonably new to all this

  4. #4
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    more than likely, you can simply refer to that book in your access code, and run a macro on it as well. If you don't know how to use macros in one excel book that come from another book, record the same process in excel and copy the code into access. that's how you learn stuff like this.

    by the way, this seems overly complicated. I haven't heard of any instances where someone needs to do stuff like this.

  5. #5
    zippy483 is offline Novice
    Windows 7 Access 2003
    Join Date
    Feb 2010
    Posts
    24
    If it helps Book1 is held in memory and is an acitve worksheet it is a temporary entity so to speak.

  6. #6
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by zippy483 View Post
    If it helps Book1 is held in memory and is an acitve worksheet it is a temporary entity so to speak.
    i'm not going to write the code for you, sir. I already gave you my opinion. If there's anything else I can do, just let me know.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help With Macro's
    By GDubbs780 in forum Programming
    Replies: 1
    Last Post: 02-25-2011, 11:43 AM
  2. Runing Moduels from Macro's - Access 2003
    By damo1995 in forum Access
    Replies: 7
    Last Post: 02-10-2011, 03:40 AM
  3. Replies: 0
    Last Post: 07-16-2010, 09:06 AM
  4. Running excel macro from access
    By timpepu in forum Programming
    Replies: 1
    Last Post: 02-26-2010, 11:32 PM
  5. Replies: 1
    Last Post: 08-31-2009, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums