Is there any way that one can access the macros present in an excell sheet using C# code (the host application can be either web or desktop) .i need to access the excell sheet and need to extract the macros and run those macros on the given excell sheet.
Thank you very much the links , the microsoft link has already been explored by me and the poc that i had created is working fine. What essentially, but ther is in a hiccup with the current implementation, i need to access the vbe macros dynamically , in
the given link i am giving the macros statically , as i would be access hunderads of excell sheets dynamically , i need to access the macros which are different for each sheet dynamically.
thanks a ton NihirPorecha for giving me the cmd . i was able to resolve this problem , but my requirement is like i more of like accessing 100's of excell sheets where each excell sheet is having its own vbe macros , and i need to access those macros
dynamically. can you give me any some suggestion regarding the same.
Member
105 Points
88 Posts
Reading Macros from Excell sheet.
Aug 18, 2009 09:30 AM|jaipal213|LINK
Hi All,
Is there any way that one can access the macros present in an excell sheet using C# code (the host application can be either web or desktop) .i need to access the excell sheet and need to extract the macros and run those macros on the given excell sheet.
Thanks well in advance.
Regards,
Jaipal
All-Star
32861 Points
7877 Posts
Re: Reading Macros from Excell sheet.
Aug 19, 2009 07:39 AM|qwe123kids|LINK
Hi,
http://support.microsoft.com/kb/306683
http://www.c-sharpcorner.com/UploadFile/jodonnell/Excel2003fromCSharp12022005021735AM/Excel2003fromCSharp.aspx
Chk the above link
Avinash Tiwari
Remember to click “Mark as Answer” on the post, if it helps you.
Contributor
2231 Points
613 Posts
Re: Reading Macros from Excell sheet.
Aug 19, 2009 07:46 AM|NihirPorecha|LINK
To run the macro you can use
objExcel.Application.Run("macroname",macroarguments) method.
Here, you first need to object the instance of the excel file. Hope, it will help you.
My blog
Member
105 Points
88 Posts
Re: Reading Macros from Excell sheet.
Aug 24, 2009 09:44 AM|jaipal213|LINK
Greetings Avinash,
Thank you very much the links , the microsoft link has already been explored by me and the poc that i had created is working fine. What essentially, but ther is in a hiccup with the current implementation, i need to access the vbe macros dynamically , in the given link i am giving the macros statically , as i would be access hunderads of excell sheets dynamically , i need to access the macros which are different for each sheet dynamically.
Regards,
Jaipal Vallabhaneni
Member
105 Points
88 Posts
Re: Reading Macros from Excell sheet.
Aug 24, 2009 09:47 AM|jaipal213|LINK
thanks a ton NihirPorecha for giving me the cmd . i was able to resolve this problem , but my requirement is like i more of like accessing 100's of excell sheets where each excell sheet is having its own vbe macros , and i need to access those macros dynamically. can you give me any some suggestion regarding the same.
Regards,
Jaipal.