Scripts
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb Site ManagementScripts

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 22nd, 2004, 04:15 AM
Dave Taylor Dave Taylor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 Dave Taylor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
VB Script to Launch Excel

Hi I am new to this forum, I hope I am placing my question in the right place. I am very new to VB script. I am trying to launch Excel from IE so that Excel runs in its own right i.e. not inside IE.

I have found the script below on the Web

<SCRIPT LANGUAGE=VBScript>
Dim objExcel

Sub Btn1_onclick()
call OpenWorkbook("Test.xls")
End Sub

Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Open strLocation
objExcel.Visible = true
objExcel.WindowState = xlMinimized
objExcel.WindowState = vbMaximizedFocus
objExcel.WindowState = vbMaximized
objExcel.UserControl = true

End Sub

</SCRIPT>

This seems to open Excel but it stays behide the web page that it is launched from (i.e. Flashing Excel on the task bar)

Because Excel does not start properly then my VBA does not run correctly.

How can I make Excel start in front of IE.

Regards, Dave

Reply With Quote
  #2  
Old October 26th, 2004, 08:24 AM
kevinwiw kevinwiw is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 4 kevinwiw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking it did work

i've tried your script and found Excel lanched on top of IE.
below is all the soure code.

<body>
<form name="lx1">
<input type=button name=btn1 value="OK">
</form>
</body>
<SCRIPT LANGUAGE=VBScript>
Dim objExcel

Sub Btn1_onclick()
call OpenWorkbook("Test.xls")
End Sub

Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Open strLocation
objExcel.Visible = true
objExcel.WindowState = xlMinimized
objExcel.WindowState = vbMaximizedFocus
objExcel.WindowState = vbMaximized
objExcel.UserControl = true

End Sub

</SCRIPT>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb Site ManagementScripts > VB Script to Launch Excel


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway