Import data through ole

Can someone explain or point me where can I find details about importing data through OLE apart from AmiBroker’s OLE Automation Object Model?

Specifically what Type stands for and how many Types there are, at the Import method of the Application Object :

Function Import(ByVal Type As Integer, ByVal FileName As String, [ByVal DefFileName As Variant]) As Long

Also if it is possible to pass multiple files that use the same format file in one command, for example:

Amibroker.Import(0, file1 file2 file3, formatFile);

Type should always be set to 0. And you need to import one file in single call to Import.
Old newsletter article includes examples


I would like to use Import() function of OLE object. The documentation is found here;

The function prototype is like this;
Function Import(ByVal Type As Integer, ByVal FileName As String, [ByVal DefFileName As Variant]) As Long

I cannot find further documentation other than the prototype. Please point me to the link for more documentation if I have missed out.

I do not know what value to use for ByVal Type As Integer and what kind of of Long value is returned. I am also not able to find description for [ByVal DefFileName As Variant].

It was already explained on the forum: How to manually import OHLC data via AFL script? and here Import data through ole

I find it hard to believe that you missed it because Discourse automatically displays existing relevant posts when you try to create new topic.


1 Like

Sorry about it. I will keep a lookout for this feature of Discourse in future when posting new topics. Do be patient with some of your slower customers.

I think it is a good practice to update all documentation into a single location. I suggest that the updated documentation on this thread be updated onto the Amibroker documentation.

As a general rule, it is confusing to customers when documentation are in multiple places.

Are you aware that to do what you are asking for in practice would mean that I could not answer e-mails or posts on forum because this is “different place” than User’s guide. If your suggestion about “single place” was implemented you would ask here and the answer would be placed in Users’ Guide and nowhere else.

There is a good old saying “be careful what you wish for”

Hi Tomasz,

Thanks for your patience in answering our posts timely, as always. What I had in mind was that if your customers can find the answers from the documentation themselves, they can bother you less on this forum and not divert your time from development.

For instance, things like description of a function should be in the documentation. Providing merely the function prototype is not enough, as was the case for Import() (see link below).