0

My C# program creates an Excel file, I want this file to have a VBA function (so the user could change something without rerunning the program). How can I do this?

Community
  • 1
  • 1
proton
  • 393
  • 6
  • 31
  • Could something like this be helpful: https://support.microsoft.com/en-us/kb/303872 ? – mmvsbg May 12 '15 at 08:36
  • @mmvsbg - This was exactly what I needed, thank you. further questions: 1. When trying to save using the .xlsm extansion i'm required by Excel to "choose a macro enabled file type", what could be the reason for that? When saving manually this does nor occur. 2. I want my function to be part of the Worksheet_Change() sub, how can I do that? – proton May 12 '15 at 11:09
  • @proton, if you have new questions, you may want to create a new StackOverflow question. Be sure to include details such as any issues you have and what you have already tried. – a_hardin May 14 '15 at 14:59

1 Answers1

0

Perhaps you could do it using the OpenXML SDK 2.0.

And parts of this answer on Stackoverflow.

Community
  • 1
  • 1
splattne
  • 102,760
  • 52
  • 202
  • 249