none
Microsoft.Office.Interop.Excel.dialog.show RRS feed

  • Question

  • On my computer when I'm using Application.Dialogs(Excel.xlBuiltInDialog.xlDialogSaveAs).Show(FileName,Excel.XlFileFormat.xlExcel8)

    Is ok.

    But when I'm deploying my solution on customer.  All computer the dialog box is on the back of the software.

    The costumer doing ALT+TAB to switch to save dialog box each time.

    How I can force the focus to the Save dialog box

    Francois.


    Wednesday, May 16, 2012 2:12 PM

Answers

All replies

  • On my computer I'm using Excel version 14 (2010) and costumer is Version 12(2007)

    I try the software on other computer on my network there are Excel 2007,

    When I'm execute the program on Visual Studio 2010 It's ok, but when I' running the program.exe out of Visual Studio 2010 the probleme was there.

    My conclusion is when the Customer are Excel 2007 the focus is not on dialog box of excel



    Wednesday, May 16, 2012 2:23 PM
  • Hi Francois,

    It's based on my experience that you might invoke Win32 API to handle it.

    Best Regards,

    T.X.

    Thursday, May 17, 2012 1:52 AM
  • Thank you for your answer.

    Do you have a example for invoke Win32 to handle it ?

    Francois.

    Thursday, May 17, 2012 2:46 PM
  • Hi Francois,

    I'm not family with it. However I think that might be a workround, I suggest you go to http://social.msdn.microsoft.com/forums/en-US/winforms/threads to see whether you can get help about win32 api that place.

    Best Regards,

    T.X.

    Friday, May 18, 2012 2:21 AM
  • I resolve with this command


    Imports System.Runtime.InteropServices

    <DllImport("user32.dll", SetLastError:=True)> _
    Private Shared Function BringWindowToTop(ByVal hwnd As IntPtr) As Boolean
    End Function


    BringWindowToTop(oExcel.Hwnd)

    Wednesday, May 23, 2012 12:36 PM