+ Reply to Thread
Results 1 to 14 of 14

Folder select box appears behind the active window?!?

  1. #1
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Folder select box appears behind the active window?!?

    I have a macro attached to a button in outlook. all this button does is start and excel workbook and start a marco in excel, then closes the excel workbook.

    this is the code in outlook

    Please Login or Register  to view this content.
    the first part of the code in excel opens a folder picker dialogue box. but the dialogue box opens behind everything that is open.....

    Please Login or Register  to view this content.
    so i though AH HA! i'll minimise outlook at the first part of the code, and it worked. But if i have another window open, my diaglogue box opens behind that too. i think its because Excel is opening in the background, is there any way of forcing it to open in the foreground?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Try adding:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    where would i add that?

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Before your xlApp.Run line.

  5. #5
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    tried it before, after etc and it still have the same effect.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Try this:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    Right, only just got back on this.

    Romper, your method works (as you know) but it opens excel as well.....all i need to do is force the dialogue box to the front. as it opens inthe background, and excel doesnt open

    i did find this. http://stackoverflow.com/questions/8...-basic-not-vba but I can not seem to get it to work.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Excel does open, it was just invisible before. I don't think AppActivate will work if Excel is hidden but you could try using:
    Please Login or Register  to view this content.
    and comment out the
    Please Login or Register  to view this content.
    line.

  9. #9
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    the weird thing is, if i open and close the Visual Basic editor in outlook, then run my original code, the dialogue box then opens infront of all applications until i close outlook. then it reverts back to opening behind all open windows.

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Try automating that then?

  11. #11
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    Keh?

    This text is just to pad out the messgae, as the forum said "Keh?" was too short for a reply.

  12. #12
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    Just worked it out

    Please Login or Register  to view this content.

  13. #13
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Folder select box appears behind the active window?!?

    Why use GetObject when you already have a reference to the application?
    Please Login or Register  to view this content.
    rather than:
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-25-2007
    Posts
    40

    Re: Folder select box appears behind the active window?!?

    i was going to go through it, its a bastardised part from another macro, as i wrote it.

    it seems to work gfine on my PC but not a collegues. ARRRGHHH!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. resize active window ie: add to the height of the active window
    By hopefulhart in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-07-2014, 01:55 AM
  2. need help in making the current window as active window.
    By ashvija in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-27-2012, 06:04 PM
  3. Select folder from an Input box and insert .PDF files from that folder
    By davesexcel in forum Outlook Programming / VBA / Macros
    Replies: 6
    Last Post: 12-12-2009, 02:47 PM
  4. Replies: 2
    Last Post: 05-07-2006, 03:20 PM
  5. [SOLVED] How to select range of Active Window
    By Jan in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-01-2006, 01:10 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1