Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automating from javascript - can't get Excel window to front

I 've written some Javascript code to export a bunch of data to a an
Excel worksheet Everything works exactly as I would like, except that
the Excel window is not opening in front of the browser window; the
Excel window appears on the taskbar, blinking, and I need to click it
to bring it to the front. Here is my code; what am I missing?

function ExportExcel() {
// Open Excel and export the view data to it
var oXL = new ActiveXObject("Excel.Application");
oXL.Visible = true;

var oWB = oXL.Workbooks.Add();
var oSheet = oWB.ActiveSheet;

// Put the data on the sheet
var RangeStart = 'A2';
var RangeEnd = 'E500';
var RangeText = RangeStart + ':' + RangeEnd;
var oRange = oSheet.Range(RangeText)

// GetExcelArray() simply returns the data
oRange.Value = GetExcelArray();

oXL.Visible = true;
oXL.UserControl = true;
}

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
Help: Javascript to Excel VBA? Ron J Excel Programming 3 April 6th 06 03:28 AM
Open a webpage using Javascript in Excel [email protected] Excel Programming 5 January 17th 06 09:05 PM
Need macro bring internet explorer window to front Henpecked Excel Programming 0 November 17th 05 02:40 AM
Setting to Keep a Spreadsheet in Front Window carl Excel Worksheet Functions 0 November 1st 05 02:54 PM
Possible to write Excel macros in JavaScript? Christopher M. Balz Excel Programming 0 December 16th 03 10:27 PM


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

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

About Us

"It's about Microsoft Excel"