Excel and the Amibroker's database

#1
Hello!! I have done a small VBA program with a small bug .
I think that I have this bug because I don't know how to install and use the file
Broker4705.tlb
on my computer ...

So my question is very sample how to install the file Broker4705.tlb ?

Here is my VBA code wich is meeting a bug with the method "refreshall"
Code:
Sub test()

Dim derlign As Integer
derlign = Worksheets(1).Range("A65536").End(xlUp).Row + 1

Dim Amibroker As Object
Set Amibroker = CreateObject("Broker.application")

Dim i As Integer
Dim a, b, c As String
Dim collectiondestock As Object

For i = 1 To derlign

a = Val(Left(Cells(i, 6).Value, 1)) 
'a = Left(a, 1)  
b = Cells(i, 5).Value & ".PA" 
c = Cells(i, 1).Value 



If a <> 0 Then   
Set collectiondestock = Amibroker.stocks.Add(b)
collectiondestock.FullName = c
collectiondestock.IndustryID = a
End If

Next i

Set collectiondestock = Amibroker.RefreshAll()   'did not work ?!
   Set Amibroker = Nothing

End Sub
The kind of .xls that I use is on http://www.euronext.com otherwise a file is joined .
 
#2
I have found the solution , sorry to speach alone ...
Hope that my post have interessed somebody ...

Code:
Sub test()

Dim derlign As Integer
derlign = Worksheets(1).Range("A65536").End(xlUp).Row + 1

Dim Amibroker As Object
Set Amibroker = CreateObject("Broker.application")

Dim i As Integer
Dim a, b, c As String
Dim collectiondestock As Object

For i = 1 To derlign

a = Val(Left(Cells(i, 6).Value, 1)) 
'a = Left(a, 1)  
b = Cells(i, 5).Value & ".PA" 
c = Cells(i, 1).Value 



If a <> 0 Then   
Set collectiondestock = Amibroker.stocks.Add(b)
collectiondestock.FullName = c
collectiondestock.IndustryID = a
End If

Next i

   Amibroker.RefreshAll     'without parenthses after the word "Refreshall"  
   Set Amibroker = Nothing

End Sub
 
#4
Dear all

I have IRIS which has a DDE link and generates the Excel file that has OHLC, Vol etc and is in real time. I also use Amibroker, Prof version. How do I link this to get the realtime data in AB? Help required
 
#7
To sdebu_2000 .
Look at this in the Amibroker User's Guide .
Folder "database management"/ Understanding catgories .

At the bottom of the tutorial "Making it automatique" there is a link

"4 th issue of Amibroker Tips Newsletter" .

In fact the programm has been done in javascript and vbscript .I have done the same in VBA .

The purpose is to build quikly a database with the ticker's names wich are in a excel file .(see the excel file that I have joined) . The ticker is typed automatically and is put in the right folder , the good sector ...Depending what you need .

For the first database it is slowly that If I have done it by the hand but for the second database and if the excel file is good then It will be faster !
 

Similar threads