locked
Changing program from VB 2005/VB6 to VB 2008 Express Edition

    Question

  • Ok, so I have a program that someone gave me that open in Excel and then you go to the Visual Basic Editor in Excel. I think he made it either Visual Basic 2005 or Visual Basic 6. I'm using Visual Basic 2008 Express Edition and what I'm trying to do is I'm trying to publish the program so that is a program on it's on with a .exe icon and everything. The purpose of trying to do this is to create a more user friendly way of using the program. However, when I go from Excel to the VB Editor it opens it up in an older version of VB. Does anyone have any suggestions?
    Thursday, October 22, 2009 5:43 PM

Answers

  • That older version is called VBA, Visual Basic for Applications. 
    It wasn't designed to be very portable when it was first conceived. 
    Well....At least the process wasn't a simple matter of "Load Project" and you were done.

    I hope someone has a better idea than me.  You will need to rebuild it by hand.
    There are too many unknowns for an automated process to account for when it tried to translate it from VBA to .NET.

    Mark the best replies as answers. "Fooling computers since 1971."
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Thursday, October 22, 2009 6:06 PM
  • DeMolay,

    VBA is basically a filtered down version of VB6.

    what you might look into is to create an installer for your excel workbook.  you can include the excel file as the "executable" and create shortucts, etc...  you cuold even create a simple application in vb 2008 express which will just be to start the workbook.  you wouldn't have to show the form, you just load the form without it being shown and then use the application to start your workbook in excel.  it is very easy thing to do this way with process.start("path to your workbook").  after you call start, you close your application and excel is not open with your workbook.

    another option is to use spreadsheetgear for .net.  this would allow you to create a view in your vb 08 express applicaiton on a form to load the workbook and work with it inside your application.  there is a free version in your vb express registration benefits.  very handy tool.  not everything is compatible and your macros would not work but may make some thing easier depending on what the workbook does.

    i have not played with it but you should be able to show excel as a window inside one of your forms in vb express as well.  this would make it appear excel is a part of your application.

    just some suggestions.
    FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Friday, October 23, 2009 12:36 PM
  • Office applications run in their own application environment and cannot be easily ported to .NET. You might be able to convert some of the code into .NET but I would expect many changes since it's probably working with Excel objects.

    In any event, even if you do convert the application to .NET, Microsoft Excel will probably still need to be installed in order to run the automation code. If the application is not using any Excel objects then it will probably be much easier to convert. However, any user interface components (e.g. MS Forms) will need to be recreated/rewritten.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Friday, October 23, 2009 3:28 PM

All replies

  • That older version is called VBA, Visual Basic for Applications. 
    It wasn't designed to be very portable when it was first conceived. 
    Well....At least the process wasn't a simple matter of "Load Project" and you were done.

    I hope someone has a better idea than me.  You will need to rebuild it by hand.
    There are too many unknowns for an automated process to account for when it tried to translate it from VBA to .NET.

    Mark the best replies as answers. "Fooling computers since 1971."
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Thursday, October 22, 2009 6:06 PM
  • Have you tried using vb6 to vb 2008 express converter ? it might help
    you can try to search on google.com for the software
    Friday, October 23, 2009 8:38 AM
  • DeMolay,

    VBA is basically a filtered down version of VB6.

    what you might look into is to create an installer for your excel workbook.  you can include the excel file as the "executable" and create shortucts, etc...  you cuold even create a simple application in vb 2008 express which will just be to start the workbook.  you wouldn't have to show the form, you just load the form without it being shown and then use the application to start your workbook in excel.  it is very easy thing to do this way with process.start("path to your workbook").  after you call start, you close your application and excel is not open with your workbook.

    another option is to use spreadsheetgear for .net.  this would allow you to create a view in your vb 08 express applicaiton on a form to load the workbook and work with it inside your application.  there is a free version in your vb express registration benefits.  very handy tool.  not everything is compatible and your macros would not work but may make some thing easier depending on what the workbook does.

    i have not played with it but you should be able to show excel as a window inside one of your forms in vb express as well.  this would make it appear excel is a part of your application.

    just some suggestions.
    FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Friday, October 23, 2009 12:36 PM
  • You can also use the VB6 program with your .NET program as well through .NET interoperability.

    If you convert it line by line it will be pain to do so. Try the tool that viastain mentioned.
    Ganesh Ranganathan
    [Please mark the post as answer if it answers your question]
    blog.ganeshzone.net
    Friday, October 23, 2009 12:56 PM
  • You can also use the VB6 program with your .NET program as well through .NET interoperability.

    If you convert it line by line it will be pain to do so. Try the tool that viastain mentioned.
    Ganesh Ranganathan
    [Please mark the post as answer if it answers your question]
    blog.ganeshzone.net


    VBA and VB6 are entirely different beasts, as Jeff noted.
    I don't think your suggestion would work at all.
    The code is 'packaged' up inside of the worksheet files.

    Mark the best replies as answers. "Fooling computers since 1971."
    Friday, October 23, 2009 2:16 PM
  • Office applications run in their own application environment and cannot be easily ported to .NET. You might be able to convert some of the code into .NET but I would expect many changes since it's probably working with Excel objects.

    In any event, even if you do convert the application to .NET, Microsoft Excel will probably still need to be installed in order to run the automation code. If the application is not using any Excel objects then it will probably be much easier to convert. However, any user interface components (e.g. MS Forms) will need to be recreated/rewritten.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Xingwei Hu Wednesday, October 28, 2009 7:56 AM
    Friday, October 23, 2009 3:28 PM