Consulting

Results 1 to 3 of 3

Thread: To open Another Excel in a different Window using code

  1. #1
    VBAX Regular
    Joined
    Sep 2008
    Location
    In a house.
    Posts
    73
    Location

    To open Another Excel in a different Window using code

    Hello all,

    I have an excel program that has a userform that I use. When I need to open another excel file it hides behind the userform. I was wondering if I can place code in the excel file that has the userform to force excel to open a seperate window when opening a new excel file.

    Is this possible?

    Thanks for all your help guys,

    -B

  2. #2
    Knowledge Base Approver VBAX Guru GTO's Avatar
    Joined
    Sep 2008
    Posts
    3,368
    Location
    Greetings B,

    Not sure if this is what you mean, but if there's an advantage to keeping the userform displayed, you could either .Show the userform as vbModeless in order to be able to interact with the sheet(s) while the form is displayed, or, you could create a second instance of Excel.

    Maybe something like:
    [vba]
    Option Explicit

    Private Sub CommandButton1_Click()
    Dim XL As Excel.Application
    Dim wb As Workbook

    Set XL = New Excel.Application
    XL.Visible = True
    Set wb = XL.Workbooks.Open(ThisWorkbook.Path & "\Book2.xls")
    Set wks = wb.Worksheets("Sheet1")
    '... and so on...
    End Sub
    [/vba]

    Does that help?

    Mark

  3. #3
    VBAX Regular
    Joined
    Sep 2008
    Location
    In a house.
    Posts
    73
    Location
    Thank you. That does help. One issue is when I open an excel file not from the userform but from a folder is there a way to force that file to open in a seperate window if I have my userform up.

    I have links on my userforms to websites. Some of those websites have excel files that open when clicked on. I was wondering when I click on those links on the website and it opens excel that it does it in a new window.

    I hope this make sense.

    Again thanks for your help,

    -B

Posting Permissions

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