locked
Converting code that runs on excel to asp RRS feed

  • Question

  • User-1106011126 posted

    I have a system that runs under excel vb and I want to convert it to run in asp on my site.  I boldly set about converting and at first it seemed easy enough.  I've learned differently.

    It seems that most of the codeconverts directly, but the missing elements are the basic IO statements such as open, close, get, put and write.  The reference manuals

    I found seem to have obliterated all reference to those.  There was a promising bit I found on the forum that talked about a wizard that will convert code from VB6 to asp.net vb. 

    If someone out here understands my dilemma, I'd appreciate the following:  First, am I in the correct universe?  My excel is excel 2010. Is the vb there vb6? Why do I not find this wizard running in my vs 2010?

    Finally, do I need to start learning everything from the bottom up, I'e., namespaces, methods and classes?  I've gotten by without this layer for 50 years, but I'll do what it takes and will appreciate a headstart from anyone.

    Thursday, June 5, 2014 4:33 PM

Answers

  • User-821857111 posted

    Rather than start from scratch with VB (cause you know more of it than you perhaps realise at the moment), just Google what it is that you want to do and try the code you find in your search results:

    https://www.google.com/?q=open+file+vb

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 6, 2014 2:32 AM

All replies

  • User753101303 posted

    Hi,

    Excel uses VBA (Visual Basic for Application). An Excel application and a web application have not much in common. So I'm not sure what this app does but the conversion is unlikely that easy. For example you won't be able to write on the client side disk. This is sometimes a catch for beginners as typically when you create a web app on your dev box, the server and the client are the same machine so it can give the impression that your code can access the client side disk. Once it is deployed, you then realize that the server code is actually only able to write to the web server disk.

    Thursday, June 5, 2014 5:12 PM
  • User-821857111 posted

    The code in your Excel application is likely to be VBA. This might help although it is quite old: http://msdn.microsoft.com/en-us/library/office/aa192490(v=office.11).aspx. However, I suspect your only solution is to rewrite from scratch. You could paste the VBA code into a Web Form and then try to fiix errors, but that way usually only leads to a world of pain and frustration in my experience. So, yes, you will have to learn what you need to learn.

    Thursday, June 5, 2014 5:14 PM
  • User-1106011126 posted

    I am delighted with your response.  I can live with not being able to access the client disk.  My app creates a couple of reports that could be displayed after it runs.  My problems are knowing asp vb and how to implement the basic commands of opening,  reading/writing and closing files.  I gather that this is where I need to learn all about methods and namespaces.   I appreciate your effort.  What do you advise as the next step toward illumination?  The walkthroughs of MS, or is there something less time-consuming?

    Thursday, June 5, 2014 6:49 PM
  • User-821857111 posted

    Rather than start from scratch with VB (cause you know more of it than you perhaps realise at the moment), just Google what it is that you want to do and try the code you find in your search results:

    https://www.google.com/?q=open+file+vb

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, June 6, 2014 2:32 AM
  • User-1106011126 posted

    Just to complete the issue, I was able to come very close to a valid answer thru the addition of the "imports Microsoft.visualbasic"

    Thursday, July 3, 2014 1:40 PM