Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Location
    Ottawa, Ontario, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automation Webbrowser control (vb6/Office 2000)

    I have created an app that uses a webbrowser control to open an excel sheet.

    I am using this syntax to open the excel sheet
    WebBrowser1.Navigate2 sFileName

    On most computers I have tested on this results in the excell spreadsheet opening in the browser control on my form. However on my clients computer the spreadsheet opens in a new browser window.

    I know I can accomplish this with WebBrowser1.Navigate2 sFileName,1
    with the 1 flag meaning open in a new window!

    How can I ensure it will always open in the browser on my form.

    maybe ? WebBrowser1.Navigate2 sFileName,null ?

    Any suggestion would be appreciated
    Environment: vb6 SP5 /Excel 2000 /IE 6 /Windows 2000 OS

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Location
    Ottawa, Ontario, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation Webbrowser control (vb6/Office 2000)

    Thanks, jscher2000

    I have been to this page.
    The problem is not what it does say,but what it does not say. To open the spreadsheet in a new window the flag is 1
    Would I be safe in assuming the default for this control is the current window?
    I have tried passing null,O and nothing at all to this optionan flag. I have also used "_SELF" in the TargetFrameName Parameter

    This works fine on my machine (and several others I tested) But on the users machines it allways opens in a new window
    Is there a ie setting that might cause this or maybe an excel Setting?

    Any help would be appreciated

  4. #4
    New Lounger
    Join Date
    Sep 2002
    Location
    Ottawa, Ontario, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation Webbrowser control (vb6/Office 2000)

    In case anybody finds this post and is looking for an answer.

    The problem was the environment settings for filetypes the user had set. By default, Internet Explorer is configured to host documents for Office programs. However a user with admin rights can change ths setting by following these directions

    1.Double-click My Computer.
    2.On the Tools menu, click Options (or Folder Options).
    3.Click the File Types tab.
    4.In the Registered file types list, click the Microsoft Excel Worksheet xls, and then click advanced
    5.Uncheck the Browse in same window checkbox

    This will cause excel to open in excel (Not another browser window as I had originally thought).

    Hopefully this will help someone.

    Thanks !

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automation Webbrowser control (vb6/Office 2000)

    Yes, I never Browse in the same window. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Could you embed an actual Excel control in your form somehow? You'd think if the IE control can "call" one, you could use it directly...

  6. #6
    New Lounger
    Join Date
    Sep 2002
    Location
    Ottawa, Ontario, Canada
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automation Webbrowser control (vb6/Office 2000)

    I am not sure. I will have to try this for future versions. We do not want to force the users to change environment settings just to use the application

Posting Permissions

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