PDA

View Full Version : Solved: Preventing Excel from opening in IE



tomsweddy
06-23-2009, 02:42 AM
Hi,

Is there anyway to build something into the Open command of an Excel workbook to force it to open in Excel rather than in Internet Explorer? (as my workbook is downloaded off the net)

I have seen solutions like this> http://www.computerhope.com/issues/ch000462.htm but they require you to change your settings on your computer rather than the workbook itself. I have over 300 users and this would take forever this way!!!

Thanks

Oorang
06-23-2009, 03:33 AM
Hi Tom,
May I ask why this is needed? How a file opens is a user setting. Overriding user settings is considered is generally considered "poor behavior". Are you sure this is the best approach?

tomsweddy
06-23-2009, 03:53 AM
Basically I need to make this change because, when my workbook is opened in IE lots of the VB code doesnt behave as it does when functioning in the proper Excel applicaiton.....

Oorang
06-23-2009, 07:56 AM
What code is not behaving as it should?

tomsweddy
06-23-2009, 08:11 AM
print previews, printing, saving........etc

all code that I have written works fine in excel, but buggers up in IE

Oorang
06-23-2009, 09:06 AM
You could just give them a button in the workbook that reopens the file in Excel:
Public Sub LaunchInExcel()
Dim strPath As String
Dim xlApp As Excel.Application
strPath = Environ$("TEMP") & "\" & GetGUID & ".xls"
ThisWorkbook.SaveCopyAs strPath
Set xlApp = New Excel.Application
xlApp.Workbooks.Open strPath
xlApp.Visible = True
End Sub

Private Function GetGUID() As String
GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2&, 36&)
End Function

tomsweddy
06-24-2009, 02:08 AM
Great Thanks

tomsweddy
06-24-2009, 02:43 AM
Why do u need this bit?

Private Function GetGUID() As String
GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2&, 36&)
End Function

Oorang
06-24-2009, 04:51 AM
Just a way to get a temporary file name that I know won't already be in use:)