Results 1 to 4 of 4

Thread: Excel Workbook

  1. #1
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79

    Unanswered: Excel Workbook

    Is it possible to open a specific Excel Workbook from within Access?

    My forms have too many variables for my beginner skills to format the appropriate Report so I am keeping part of my files in the original Excel workbook. I would like to be able to click on a command button and open the appropriate file for updating.

    I have found many useful posts on this database and hope this is possilbe.

    Perplexed

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Excel Workbook

    Originally posted by Perplexed
    Is it possible to open a specific Excel Workbook from within Access?

    My forms have too many variables for my beginner skills to format the appropriate Report so I am keeping part of my files in the original Excel workbook. I would like to be able to click on a command button and open the appropriate file for updating.

    I have found many useful posts on this database and hope this is possilbe.

    Perplexed
    I would suggest setting a reference to the Excel object library first.

    Then use code similar to this..

    Dim oApp As Excel.Application, oBook As Excel.Workbook
    Dim strPath as string

    Set oApp = New Excel.Application
    strPath = "Path to your workbook"

    Set oBook = oApp.Workbooks.Open(strPath)

    There are quite a few arguments within that open statement but I believe that the only required one is the file name.

    That should get you started. Make sure you quit the application when done (oApp.Quit) and set it's object reference equal to Nothing.


    Gregg

  3. #3
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79
    Thank You !!!!!

    After a little poking around, I got this to work. Will make my workflow much smoother.

    You're the greatest

  4. #4
    Join Date
    Oct 2003
    Posts
    15

    Exclamation

    On a similar note, is there a way to use a command button to begin the Word Merge function? I want to merge my PurchaserInfo table into legal contracts in Word, and I want to automate the process as much as possible...

    (I'm still fairly new at all this stuff...the simpler the explanation, the better, lol)

    Thanks!
    Heather

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •