Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How to Capture if Spreadsheet is open in IE and not Excel

Constantly i find people are opening my forms which contain programming
in IE. Unfortunetly some code will not perform correctly in Ie, and
instead of figuring out what dosnt, It would be very convenient if
there were a way to tell if the spreadsheet's in ie or excel. Anyone
got any idea's?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default How to Capture if Spreadsheet is open in IE and not Excel

There was a similar post not long ago: The solution is to check the Container
property of the workbook, which "Returns the object that contains the
specified embedded workbook." If the workbook is open in IE then
ThisWorkbook.Container.Name will be "Microsoft Internet Explorer." If it is
open in Excel, there is no "container" since it is not embedded, and the
property call will error out, so you need error trapping to catch that:

Public Function ExcelOrIE() As String
Dim CName as String

On Error Goto MustBeExcel
CName = ThisWorkbook.Container.Name

If CName = "Microsoft Internet Explorer" Then CName = "IE" Else CName =
"Something Else"

ExcelOrIE = CName
Exit Function

MustBeExcel:
ExcelorIE = "Excel"

End Function

"UBER_GEEK" wrote:

Constantly i find people are opening my forms which contain programming
in IE. Unfortunetly some code will not perform correctly in Ie, and
instead of figuring out what dosnt, It would be very convenient if
there were a way to tell if the spreadsheet's in ie or excel. Anyone
got any idea's?

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spreadsheet will not open without Excel Application being open fir Deirdre Lysaght Excel Discussion (Misc queries) 1 November 13th 07 04:11 PM
Excel screen capture to capture cells and row and column headings jayray Excel Discussion (Misc queries) 5 November 2nd 07 11:01 PM
Is there a formula to capture data between "Tabs" on a spreadsheet Dan the Man[_2_] Excel Worksheet Functions 17 July 6th 07 08:51 PM
Can I open a spreadsheet If I don't have excel Dorothy Rowland Excel Discussion (Misc queries) 1 June 11th 05 03:24 AM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"