C#- Importing Excel With Macros RRS feed

  • Question

  • Hi,

    I am using the excel which contains macros and password protected. The excel contains several drop-downs and worksheets are protected.

    I am uploading the C# to the server its working. And after downloading  its working but getting compatibility checked.

    In the Program when i load the excel using C# interop libraries and try to write the in some cells and use the Excel Application SaveAS(...) the excel getting saved but dont have any dropdows and  the existing validations when closing the excel are also not working.

    Is this due to the macors disabled while saving the excel..Please help..

    Thanks in Advance..


    Thursday, September 15, 2016 5:47 PM

All replies

  • Hi P.Pradeep,

    Since your problem is more related to excel for developers, I move it to excel for developers forum for support.

    The Visual C# forum discuss and ask questions about the C# programming language, IDE, libraries, samples, and tools.

    If you have some grammar or code errors, please feel free to contact us. We will try our best to give you a solution.

    Thanks for your understanding and cooperation.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 16, 2016 3:09 AM
  • Hi,

    What C# application are you developing? A document-level add-in or Excel Automation? Could you please share more detail information with us?

    According to your description, do you protect the document by the macro in the excel, and using C# to load and operation, the change would not be saved?

    Do you try to do these work manually and if it could be saved successfully?

    If you think it might be caused from Macro settings, what is your macro setting in the excel?

    I suggest you operate manually and see if you would get any error message.

    Friday, September 16, 2016 6:51 AM
  • In 2010 Validation structure has been changed. So if you open a file (which was last saved by 2010 and uses validation) it will work in 2007 except validation.

    This may be a possible cause. If it is then work around is to run compataibilty checker in 2010 and then save.

    <font face="Calibri">Best Regards,<br/> Asadulla Javed, Jadavpore, Asansol<br/> ---------------------------------------------------------------------------------------------<br/>

    Friday, September 16, 2016 9:39 AM