Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Minimising windows (Access & Excel 97)

    Hi there,

    I have created an Access database which 'reads in' data from templates which have been created in Excel. The user is in Access then clicks a button which calls a macro that is written in Excel which in turn opens up a file dialog box. My problem is that the file dialog box is opened behind the Excel sheet which is necessary to call to run the macro (it contains other data). I have tried minimising the excel window with the normal command
    'Application.WindowState = xlMinimized
    but unfortunately the application in this case is MS Access. How else could I try minimising the window so that the user does not have to di it themselves?

    Thankyou for your help,
    Nick.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Minimising windows (Access & Excel 97)

    This kind of problem can be tough. How are you running the Excel macro? Are you using Automation?

  3. #3
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Minimising windows (Access & Excel 97)

    I am.

    To give you a bit of extra background. I have been involved in developing the Excel macro and a colleague of mine has developed the SQL and various queries in Access.

    As I understand it the process is automated, and I guess the quick fix from my point-of-view would be to add a command to the VBA code in Excel (I'm not sure of how it would work in Access).

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Minimising windows (Access & Excel 97)

    Without seeing the code it is hard to know the cause. But if you use Norton (Symantec) AntiVirus, make sure that the Office plug-in is turned off (see Turning on and turning off the Norton AntiVirus plug-in for Microsoft Office).

  5. #5
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Minimising windows (Access & Excel 97)

    Thanks for replying.

    I am not using Norton AntiVirus. I am happy to show you the VBA code I am using but I can't show you the Access code.

    Please find the relevant parts attached.

    Thanks again,

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Minimising windows (Access & Excel 97)

    If the dialog appears behind the Excel window, minimizing Excel wouldn't help - the File Open dialog can only be displayed if Excel is NOT minimized. I think you'll have to instruct the users to use Alt+Tab.

  7. #7
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Minimising windows (Access & Excel 97)

    Hi,
    What is in the openfile function? In 2002, if I create an Excel Application variable, make it invisible and then invoke Application.GetOpenFileName, the dialog appears but the application does not. Can't remember if that function existed in 97 and not sure if similar routines would work but it may be worth a try?
    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

  8. #8
    New Lounger
    Join Date
    Mar 2006
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Minimising windows (Access & Excel 97)

    Thanks for that, I'll give it a go and let you know.

    If it helps I have attached the openfile function FYI.

Posting Permissions

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