Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Adventures with Excel and VBA

Adventures with Excel and VBA

Scheduled Pinned Locked Moved The Lounge
comcsharpc++html
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dario Solera
    wrote on last edited by
    #1

    I needed to load some data in Excel from an external system, which you can interact with using a C++ DLL. First thing, I tried to import the DLL functions in VBA with no luck, because the runtime wasn't able to find some dependencies (which of course were all available :| ). Next, I tried to build a .NET wrapper for the C++ DLL, and tried to use COM Interop to register it as a COM object, still with no luck, because I never used COM in my life, so I couldn't even figure out the basics (although I've been able to register the library). I then decided to go quick and dirty. I wrote a program which outputs the needed data directly on a CSV file. In Excel I registered a macro for importing the external data from disk, and I also wrote a macro to launch the program and wait for the result. Well, it works, but I hate all of this naive stuff. :|

    If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Blog - My Photos - ScrewTurn Wiki

    B L 2 Replies Last reply
    0
    • D Dario Solera

      I needed to load some data in Excel from an external system, which you can interact with using a C++ DLL. First thing, I tried to import the DLL functions in VBA with no luck, because the runtime wasn't able to find some dependencies (which of course were all available :| ). Next, I tried to build a .NET wrapper for the C++ DLL, and tried to use COM Interop to register it as a COM object, still with no luck, because I never used COM in my life, so I couldn't even figure out the basics (although I've been able to register the library). I then decided to go quick and dirty. I wrote a program which outputs the needed data directly on a CSV file. In Excel I registered a macro for importing the external data from disk, and I also wrote a macro to launch the program and wait for the result. Well, it works, but I hate all of this naive stuff. :|

      If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Blog - My Photos - ScrewTurn Wiki

      B Offline
      B Offline
      Brady Kelly
      wrote on last edited by
      #2

      Dario Solera wrote:

      Well, it works, but I hate all of this naive stuff.

      Naive or native? ;)

      I do not believe they are right who say that the defects of famous men should be ignored. I think it is better that we should know them. Then, though we are conscious of having faults as glaring as theirs, we can believe that that is no hindrance to our achieving also something of their virtues. - W. Somerset Maugham My New Blog

      1 Reply Last reply
      0
      • D Dario Solera

        I needed to load some data in Excel from an external system, which you can interact with using a C++ DLL. First thing, I tried to import the DLL functions in VBA with no luck, because the runtime wasn't able to find some dependencies (which of course were all available :| ). Next, I tried to build a .NET wrapper for the C++ DLL, and tried to use COM Interop to register it as a COM object, still with no luck, because I never used COM in my life, so I couldn't even figure out the basics (although I've been able to register the library). I then decided to go quick and dirty. I wrote a program which outputs the needed data directly on a CSV file. In Excel I registered a macro for importing the external data from disk, and I also wrote a macro to launch the program and wait for the result. Well, it works, but I hate all of this naive stuff. :|

        If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Blog - My Photos - ScrewTurn Wiki

        L Offline
        L Offline
        loket
        wrote on last edited by
        #3

        I think you better run to the correct forum before the wolfs get here. ;) ( Edit: There does not seem to be any question there though, so i take it back :) )

        /M


        - Don't sweat the petty things, and don't pet the sweaty things.

        D 1 Reply Last reply
        0
        • L loket

          I think you better run to the correct forum before the wolfs get here. ;) ( Edit: There does not seem to be any question there though, so i take it back :) )

          /M


          - Don't sweat the petty things, and don't pet the sweaty things.

          D Offline
          D Offline
          Dario Solera
          wrote on last edited by
          #4

          loket wrote:

          ( Edit: There does not seem to be any question there though, so i take it back )

          I avoided even to write a single question mark. Only affirmative statements. :-D

          If you truly believe you need to pick a mobile phone that "says something" about your personality, don't bother. You don't have a personality. A mental illness, maybe - but not a personality. - Charlie Brooker My Blog - My Photos - ScrewTurn Wiki

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups