Do I lose the benefits of macro recording if I develop Excel apps in Visual Studio?

Posted by DanM on Stack Overflow See other posts from Stack Overflow or by DanM
Published on 2010-03-16T23:25:42Z Indexed on 2010/03/16 23:41 UTC
Read the original article Hit count: 177

Filed under:
|
|
|
|

I've written lots of Excel macros in the past using the following development process:

  1. Record a macro.
  2. Open the VBA editor.
  3. Edit the macro.

I'm now experimenting with a Visual Studio 2008 "Excel 2007 Add-In" project (C#), and I'm wondering if I will have to give up this development process.

Questions:

  1. I know I can still record macros using Excel, but is there any way to access the resulting code in Visual Studio? Or do I just have to copy and paste then C#-ize it?

  2. What happens with my "Personal Macro Workbook"? Can I use the macros I have stored in there within C#? Or is there some way to convert them to C#?

  3. If there is some support for opening and editing VBA macros in Visual Studio, can you provide a very brief summary of how it works or point me to a good reference?

  4. Do you have any other tips for transitioning from writing macros in VBA using Excel's built-in editor to writing them in C# with Visual Studio?

© Stack Overflow or respective owner

Related posts about excel

Related posts about excel-vba