Start A New Application

  • Hi All,


    I have an excel file which automatically loads an user form once the file is opened and when the user form is closed, the file also closes. When the file is open i am not able to switch to anyother excel file because this userform is active. Is there a way, when i open the file with userform, a New excel application starts. So that i can use the other excel files opened by the previous excel application.


    Thanks

    Regards,
    Salim Thaj

  • Re: Start A New Application


    Hi,



    Absolute simplest way is to just run Shell command:


    [vba]
    Private Sub Workbook_Open()


    'run shell code
    s = Shell("Excel")


    'show form
    UserForm1.Show


    End Sub


    [/vba]


    Otherwise, perhaps open your form NonModal


    [vba]
    UserForm1.show vbmodeless
    [/vba]

  • Re: Start A New Application


    Thanks for the help...


    But there is a Small problem....


    The Code given for Shell opens a new excel application while the userform is opened in the existing application, as a result i still am not able to work on the other excel files that were open already. The New excel application only has a new file....

    Regards,
    Salim Thaj

  • Re: Start A New Application


    You can open a new instance of Excel, and then open the workbook with the userform in that instance. Then you can bounce back and forth between the two instances.


    But first, you might try Reafidy's suggestion to open the form modelessly.

    [SIZE=1]Entia non sunt multiplicanda sine necessitate.[/SIZE]

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!