Register Login
Forums    February 9, 2012
TradersStudio Forums
Controlling TradersStudio from Excel
Last Post 08-27-2008 04:57 PM by Thomas Bengtsson. 7 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Thomas Bengtsson
New Member
New Member
Posts:11

--
08-25-2008 02:06 PM

    Is it possible (I would think that it is given the claim of having a complete OLE interface with Excel) to run TradersStudio macros from Excel?

    I want to create a Excel interface where I can feed variables to TradersStudio macros from Excel. The logic of the VBA code would be something like:

    'Start of code

    Misc code to set the appropriate values for variables to use in creating TradersStudio sessions and running the sessions

    Activate connection to TradersStudio

    In TradersStudio, RunMacroCreateSession (MomSeries, ChildSeries,,,,) where MomSeries and other variables are declared in the Excel code. Obviously I would first code the RunMacroCreateSession macro in TradersStudio to do what I want it to do with the variables provided.

    RunMacroSessionAndCreateTxtFile(Param1, Param2), which would run the session just created and where Param1 and Param2 would come from Excel variables. The TradersStudio macro would create a txt file with the results from the session, and the VBA code could then open the txt file for further processing. RunMacroSessionAndCreateTxtFile would be a macro already I created in TradersStudio.

    'End of code

    I was wondering if anyone had any examples of how to reference TradersStudio in the VBA code to get this to work, similar to how you can control Word or Access from within Excel using VBA code. I am reasonably confident I can get the VBA code to work as long as I know how to establish the TradersStudio connection.

    I appreciate any help on this.

    Best regards,

    tbengtsson

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-25-2008 04:41 PM
    You can control Excel from TradersStudio but I without some extra-coding in VB 6.0 or C++ I don't think you can do it the other way around.
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-25-2008 04:41 PM
    You can control Excel from TradersStudio but I without some extra-coding in VB 6.0 or C++ I don't think you can do it the other way around.
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-25-2008 04:41 PM
    You can control Excel from TradersStudio but I without some extra-coding in VB 6.0 or C++ I don't think you can do it the other way around.
    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-25-2008 04:41 PM
    You can control Excel from TradersStudio but I without some extra-coding in VB 6.0 or C++ I don't think you can do it the other way around.
    Thomas Bengtsson
    New Member
    New Member
    Posts:11

    --
    08-27-2008 03:31 PM

    I am definetely expecting to write more code to accomplish this. What I am explicitly looking for is instructions on how to initialize TradersStudio from an outside application such as Excel. To use Excel as an example, in order to access Excel through VB code from another application e.g. Word I would write

    Dim objApp as Object

    Set objApp = CreateObject("Excel.Application")

    It seems to me, since TradersStudio's objects are visible in VB if I reference the DLLs that I should be able to do the same with TradersStudio.

    I tried the following

    Dim objApp as Object

    Set objApp = CreateObject("TSProcessor.Processor")

    However, that gives me a "Permission denied" error. Since there is no documentation on this, I don't know how to continue. I can't think of a reason why TradersStudio's developers would NOT want this to be possible to do since it would greatly enhance the flexibility and usefulness of the software. I can refer you to competing products that explicitly document how to accomplish this with their software. I believe it has to do with how the software is registered in the Windows Registry but how to fix that is beyond my current knowledge.

    As usual (or actually much more than usual), I would greatly appreciate instructions on how to get this to work.

    If I should address in another way (e.e direct e-mail to tech support) please let me know.

    Best regards,

    tbengtsson

     

     

    mur ang
    Advanced Member
    Advanced Member
    Posts:525

    --
    08-27-2008 04:45 PM

    The problem is you need to get the handles for the project objects from TradersStudio.

    The only possible way would be to use two way communications. create a COM DLL which Excel can communicate with and has events enabled and is also a normal addin to TradersStudio. Look at the VB addins which come with the product for an idea of how to make this work.

    The mechanism was not designed like that because I did not see people running it form excel, I saw being able to control Excel was enough.

    Thomas Bengtsson
    New Member
    New Member
    Posts:11

    --
    08-27-2008 04:57 PM
    Thanks for the explanation. Now I have something to work with.

    Regards,
    tbengtsson
    You are not authorized to post a reply.


     TradersStudio, Inc. ® Copyright 2004-2012 All Rights Reserved   Terms Of Use  Privacy Statement