Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2006
    Posts
    157

    Red face Unanswered: How to access the appropriate workbook in excel

    hi everyone

    i have been exporting formatted data into excel using the excel application object... (works like a charm, btw)

    however, i still have troubles getting to the appropriate template:

    i am currently copying a particular (colorful) template to a user's pc.
    i open this template via shelling.

    i have no problem locating the template as long as it is in the active excel application, however (unfortunately, because the first opened instance of excel is the active appli..)
    more often than not, it's in another instance of excel...

    therefore, i need to find a way to locate that active excel application
    (but please let's not get into API if there's a simpler solution, is there?)

    many thanks
    Only quitters quit!

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    The solution to your problem involves API.

    However, there is a way of avoiding the problem in the first place

    Check out the code here:
    http://www.dbforums.com/showpost.php...81&postcount=4
    There is a procedure (ExportData_Sheet_Intermed_B) that specifically opens a template file and manipulates it. The key is that the file is opened via automation (i.e. by the active excel instance) rather than using the shell command.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2006
    Posts
    157
    just used the excel app object that I invoked in the first place...

    so i'm initializing the excel app first before anything else...
    download file - open it via the excel app



    worked like a charm...

    (should have stuck to this in the first place)
    i wonder though if i may have to use API just to maximize the window
    because the
    ExcelApp.doubleclick just doesn't work too well


    thanks, btw
    Only quitters quit!

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Code:
    ExcelApp.WindowState = xlMaximized
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Apr 2006
    Posts
    157
    many many thanks there

    i was looking for a method to fulfill that particular task
    turns out i wasn't looking hard enough (sorry about that)

    i knew i searched for 'maximize' in that library...

    once again thank you very much
    (it just looks so dramatic now when excel pops up and gradually the cells get filled in front of the user's eyes)
    Only quitters quit!

Posting Permissions

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