[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] Re: Automation Interface - can't open



PureBytes Links

Trading Reference Links




I 
didn't get an error message when I ran it. 
<FONT face=Arial color=#0000ff 
size=2> 
Try 
this script (modify the paths if you need to). Put it in the Amibroker directory 
and then run it.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>/*** AmiBroker/Win32 scripting Example**** File:  
DumpTickerAndIndustry.js** Created:  Bruce Hearder, 10 May 2002** 
Purpose:  Dumps all tickers and the stocks industry** Language:  
JScript (Windows Scripting Host)*/ var filename = "c:\\Program 
Files\\Amibroker\\Output\\TickerAndIndustry.txt"; var oAB = new 
ActiveXObject("Broker.Application");
var 
oABAA = oAB.Analysis // <-----------the only reason for this line is to get a 
visible AA window
<FONT face=Arial color=#0000ff 
size=2>var fso = new ActiveXObject("Scripting.FileSystemObject");var 
oStocks = oAB.Stocks; var StockQty = 
oStocks.Count;WScript.Echo("Started script - Exporting " + StockQty + " 
codes" );f = fso.OpenTextFile(filename, 2, true );for( i = 0; i < 
StockQty; i++ ){        oStock = 
oStocks( i );        if (oStock == null) 
continue;        f.WriteLine 
(oStock.Ticker +"!" + oStock.FullName + "!" + 
oStock.IndustryID);}f.Close();WScript.Echo("Script finished - Data 
Exported to " + filename );
<FONT face=Arial color=#0000ff 
size=2> 
This 
one runs on my machine.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>d

  
  <FONT 
  face=Tahoma size=2>-----Original Message-----From: robby4c 
  [mailto:rcole@xxxxxxxxxxxx] Sent: Thursday, April 24, 2003 11:29 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
  Automation Interface - can't openHi Dingo-Here is 
  the code that demonstrates (for me) the 
  problem:-------------------//test.js// The following works 
  as expected--var xl = new 
  ActiveXObject("Excel.Application");xl.visible = 
  1;xl.Workbooks.Add();  // Excel displayed// The following 
  gives error: "ClassFactory cannot supply requested// class"var AB = 
  new ActiveXObject("Broker.Application");// This works ok--//var 
  fso = new ActiveXObject("Scripting.FileSystemObject")// This gives the 
  same error://var oAB = 
  WScript.CreateObject("Broker.Application");--------------------------- 
  In amibroker@xxxxxxxxxxxxxxx, "dingo" <dingo@xxxx> wrote:> Why 
  don't you take a very simple version of your program (just create an> 
  object and then close/release it) and send it to either William, UM or> 
  myself and let us try it on our setups?>  > If it works on 
  our machines then the problem is on your end and you> might want to 
  contact TJ directly (send him the code at that point as> 
  well).>  > d> > -----Original 
  Message-----> From: robby4c [mailto:rcole@xxxx] > Sent: 
  Thursday, April 24, 2003 6:58 PM> To: amibroker@xxxxxxxxxxxxxxx> 
  Subject: [amibroker] Re: Automation Interface - can't open> > 
  > Hi UM--> Can't create "Broker.Application", even if AB 
  running.  As I can't> create the object through "OLE/COM Viewer" 
  tool as well (AB running or> not), I am concerned that something is not 
  right.  Anyone else> experience problem with creating 
  "Broker.Application" object??> > --- In 
  amibroker@xxxxxxxxxxxxxxx, uenal.mutlu@xxxx wrote:> > Hi 
  robby4c,> > AB must be running at the same, is it?  :-)> 
  > UM> > > > ----- Original Message ----- > > 
  From: "robby4c" <rcole@xxxx>> > To: 
  <amibroker@xxxxxxxxxxxxxxx>> > Sent: Thursday, April 24, 2003 
  11:39 PM> > Subject: [amibroker] Re: Automation Interface - can't 
  open> > > > > > > Hi William-> > 
  > > > > Thanks for your interest.  I've been through all 
  of the help files > > > and other relevant documentation - you 
  may note that the example I > > > gave is essentially from the 
  example scripts in the "Automation > > > Object Model" section of 
  the help, relative to using the new > > > automatic analysis 
  object.  My question rephrased is:  If I run the > > > 
  referenced examples, why do I get the stated error on the JScript > 
  > > statement at the beginning which instantiates the > > > 
  AB "Broker.Application" COM object?  Also, why can I not open this 
  > > > object via the MS OLE/COM Object Viewer tool?  In both 
  cases, > > > JScript/VBScript and Object Viewer, other COM 
  objects can be opened > > > as expected. > > > 
  > > > --- In amibroker@xxxxxxxxxxxxxxx, "William Peters" > 
  > > <williampeters@xxxx> wrote:> > > > 
  Hello,> > > > > > > > If you do a search for 
  "ActiveXObject" in the help file you fill > > > find some 
  examples that will help you.> > > > > > > > 
  Here is an example:> > > > AB = new 
  ActiveXObject("Broker.Application");> > > > > > > 
  > Regards,> > > > William Peters> > > > 
  > > > > > > > > > > > > 
  -----Original Message-----> > > > From: robby4c 
  [mailto:rcole@xxxx]> > > > Sent: Thursday 24 April, 2003 1:57 
  PM> > > > To: amibroker@xxxxxxxxxxxxxxx> > > > 
  Subject: [amibroker] Automation Interface - can't open> > > > 
  > > > > > > > > I've started using the 
  Jscript/VBScript facilities, but I can't > > > open > > 
  > > a new instance of the "Broker.Application" object.  With either 
  > > > > JScript or VBScript, I get the following 
  error:> > > > "Could not create object named 
  "Broker.Application"", in response > > > to:> > > 
  > "var AB = new ActiveXObject("Broker.Application"); (JScript)> > 
  > > > > > > Also, using the "OLE/COM Object Viewer" 
  utility, I see > > > > that "Broker.Application" and 
  "Broker.Document" are registered, > > > but > > > 
  > I cannot create an instance of either through the Object Viewer.  
  > > > > Instances of other COM objects can be created.> 
  > > > > > > > I'm using AB 4.30 on Win XP.  AB 
  otherwise seems to work just > > > fine.  > > > 
  > Ordinary VB/JS scripts not requiring "Broker.Application"  appear 
  > > > to > > > > work correctly.> > 
  > > > > > > I must be doing something dumb??  Can't 
  find any reference to this> > > > > in past 
  postings.> > > >> > > > Yahoo! 
  Groups Sponsor      >  > <<A 
  href="">http://rd.yahoo.com/M=249982.3179269.4495679.2595810/D=egroupweb/S=1705> 
  632198:HM/A=1524963/R=0/*<A 
  href="">http://hits.411web.com/cgi-bin/autoredir?camp=5> 
  56&lineid=3179269&prop=egroupweb&pos=HM> 
        >  > <<A 
  href="">http://us.adserver.yahoo.com/l?M=249982.3179269.4495679.2595810/D=egrou> 
  pmail/S=:HM/A=1524963/rand=431592369>       
  > > Send BUG REPORTS to bugs@xxxx> Send SUGGESTIONS to 
  suggest@xxxx> -----------------------------------------> Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx > (Web 
  page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)> 
  --------------------------------------------> Check group FAQ 
  at:> <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
  Service> <<A 
  href="">http://docs.yahoo.com/info/terms/> 
  .Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor












Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.