View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
news://news.microsoft.com news://news.microsoft.com is offline
external usenet poster
 
Posts: 1
Default Problem with managing excel embedded with IFRAME

Hello

I have a problem with embeddeing excel in iframe:

<IFRAME src="1.xls"

and this works fine. Then on client side in browser i try to do some
action with that workbookfrom javascript. The problem is, that when i
get the excel object and get ActiveWorkbook - i have my workbook,
BUT ONLY FOR FIRST OPERATION!! Example:

function setCellContent()
{
var objExcel = GetObject("","Excel.Application");

// Here is ok, alert says '1.xls'
alert("Window: " + objExcel.ActiveWorkbook.Name);

// But here it is no ok! Excel changed Active workbook
// for some other by itself...
alert("Window: " + objExcel.ActiveWorkbook.Name);
}

OK, my workbook is still in the IFRAME, i can see it, so i will try to
get it this way:

I'm looking for my '1.xls' :

alert("Window: " + objExcel.ActiveWindow.Caption);
objExcel.ActiveWindow.ActivateNext();
alert("Window: " + objExcel.ActiveWindow.Caption);
objExcel.ActiveWindow.ActivateNext();
alert("Window: " + objExcel.ActiveWindow.Caption);
objExcel.ActiveWindow.ActivateNext();
.....

There isn't !! It is imposible to set my workbook active, so
i can't do anything with it!

And i still can see it by doing this:

for (var i=1;i<=objExcel.Workbooks.Count;i++)
{
if (objExcel.Workbooks(i).Name == "1.xls")
{
alert("There it is: " + i + " " + objExcel.Workbooks(i).Name);
}
}

What is going on, please help.

Best reagards,
Michal Dabrowski