|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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> |
![]() |
| Viewing: Dev Shed Forums > Web Site Management > Scripts > VB Script to Launch Excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|