Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:26:02+00:00 2026-06-15T11:26:02+00:00

I have a code in VB6. Can anyone tell me how to write it

  • 0

I have a code in VB6. Can anyone tell me how to write it in C#. This code is below:

Set Amibroker = CreateObject("Broker.Application")
Set STOCK = Amibroker.Stocks.Add(ticker)
Set quote = STOCK.Quotations.Add(stInDate)

quote.Open = stInOpen
quote.High = stInHigh
quote.Low = stInlow
quote.Close = stInYcp
quote.Volume = stInVolume


Set STOCK = Nothing
Set quote = Nothing

What is the equivalent of CreateObject in C#?. I try to add references to com object but i can’t find any com object as Broker.Application or amibroker

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:26:03+00:00Added an answer on June 15, 2026 at 11:26 am

    If you are using .net 4 or later, and therefore can make use of dynamic, you can do this quite simply. Here’s an example that uses the Excel automation interface.

    Type ExcelType = Type.GetTypeFromProgID("Excel.Application");
    dynamic ExcelInst = Activator.CreateInstance(ExcelType);
    ExcelInst.Visible = true;
    

    If you can’t use dynamic then it’s much more messy.

    Type ExcelType = Type.GetTypeFromProgID("Excel.Application");
    object ExcelInst = Activator.CreateInstance(ExcelType);
    ExcelType.InvokeMember("Visible", BindingFlags.SetProperty, null, 
        ExcelInst, new object[1] {true});
    

    Trying to do very much of that will sap the lifeblood from you.

    COM is so much easier if you can use early bound dispatch rather than late bound as shown above. Are you sure you can’t find the right reference for the COM object?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some old code (an old but still maintained VB6 application) that from
I have a problem sending POST request with VB6. The code below works properly
I have the following (simple) VB6 code: Dim xmlDoc As MSXML2.DOMDocument30 Set xmlDoc =
I have a directory full of legacy code from a VB6 application. I have
The vb6 code I am using can inject an application into a running process.
I have the following code in vb6 - dim iFreeFile as integer iFreeFile =
we have a VB6 binary executable that comes with no source code. And we
I have code that generates a List<string[]> variable but can't quite figure out how
I have code like this in my view model: function ChatListViewModel(chats) { var self
I have code that looks more or less like the code below but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.