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. General Programming
  3. Visual Basic
  4. VB reads Excel

VB reads Excel

Scheduled Pinned Locked Moved Visual Basic
questiondatabaselearning
4 Posts 2 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.
  • B Offline
    B Offline
    Bulky Fellow
    wrote on last edited by
    #1

    I have a VB 6.0 exe. It reads data from an excel spreadsheet and writes to it as well. So, the excel spreasheet is like a database for it. Presently, the spreadsheet resides in a LAN. Now I want to "INJECT" the excel spreadsheet into the executable, so that the excel spreadsheet is not a separate entity anymore, and is a part if the executable itself. Basically, how can I turn it into an intrinsic application resource? Can someone please shed some light on how I can do this? Thanks.

    ASP - AJAX is SEXY. PERIOD.

    D 1 Reply Last reply
    0
    • B Bulky Fellow

      I have a VB 6.0 exe. It reads data from an excel spreadsheet and writes to it as well. So, the excel spreasheet is like a database for it. Presently, the spreadsheet resides in a LAN. Now I want to "INJECT" the excel spreadsheet into the executable, so that the excel spreadsheet is not a separate entity anymore, and is a part if the executable itself. Basically, how can I turn it into an intrinsic application resource? Can someone please shed some light on how I can do this? Thanks.

      ASP - AJAX is SEXY. PERIOD.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      The short answer is, you can't. An .EXE, when running, cannot be modified. The entire idea, though noble, isn't practical. You should be seperating code from data, not integrating it.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      B 1 Reply Last reply
      0
      • D Dave Kreskowiak

        The short answer is, you can't. An .EXE, when running, cannot be modified. The entire idea, though noble, isn't practical. You should be seperating code from data, not integrating it.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        B Offline
        B Offline
        Bulky Fellow
        wrote on last edited by
        #3

        Thanks Dave. I understood that. Actually, I intend to hide the excel spreadsheet from the user. And when I say hide, I don't mean just physically (as in changing the file attribute to hidden), but logically as well. I.e., the user should not be aware at all that there is an excel spreadsheet involved. With that said, is there a way to covert the spreadsheet into a resoucre of some sort? Like a dll or something which will contain the spreadsheet. Everytime the exe runs, the EXE will "upack" the spreadsheet from the resource and when done editing, it will "repack" it into the resource. Any clues regarding this mechanism? Sorry for such vague statements, but I think I've captured the essence this time. Thanks.

        ASP - AJAX is SEXY. PERIOD.

        D 1 Reply Last reply
        0
        • B Bulky Fellow

          Thanks Dave. I understood that. Actually, I intend to hide the excel spreadsheet from the user. And when I say hide, I don't mean just physically (as in changing the file attribute to hidden), but logically as well. I.e., the user should not be aware at all that there is an excel spreadsheet involved. With that said, is there a way to covert the spreadsheet into a resoucre of some sort? Like a dll or something which will contain the spreadsheet. Everytime the exe runs, the EXE will "upack" the spreadsheet from the resource and when done editing, it will "repack" it into the resource. Any clues regarding this mechanism? Sorry for such vague statements, but I think I've captured the essence this time. Thanks.

          ASP - AJAX is SEXY. PERIOD.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Bulky Fellow wrote:

          Everytime the exe runs, the EXE will "upack" the spreadsheet from the resource

          Yeah, putting the sheet into a resource is no problem - at compile time.

          Bulky Fellow wrote:

          it will "repack" it into the resource.

          Putting it back into the .EXE or .DLL at runtime is the problem. Using normal methods, once the .DLL is loaded, the file is locked until the termination of your app. Again, it can't be modified. You MAY be able to gleen something useful from the app in this[^] article though. It copies resources between .EXE's and .DLL's, but there's a lot of hoops to jump through.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
               2006, 2007

          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