As per my application I need to generate Excel files.
I am able to generate excel files with:
Response.ContentType = "application/vnd.ms-excel" in header and populating data by creating HTML Table.
But while trying to create a file fetching it from server location and saving data into it(here we are creating excel object to generate file), the web page opens with DONE status with blank page and the source file shows data in HTML format. Where as I try to open the file explicitly using the path I am getting the following errors:
it shows multiple errors like as follows: Note: ( MS-Excel DLL) is installed in the Server location.
Error message-1: Macros may contain viruses. It is usually safe to disable macros, but if the macros are legitimate, you might lose some functionality. Note: There is no macro present in the file On Clicking Enable Macros gets the second Error message:
The file could not be accessed. Try one of the following:
- Make sure the specified folder exists.
- Make sure the folder that contains the file is not read-only.
- Make sure the file name does not contain any of the following characters < > ? [ ] : | or *
- Make sure the file/path name doesn't contain more than 218 characters.
Note: All of the above conditions holds true.
And finally on clicking ok it shows the error message:
This file is not in a recognizable format.
Then it opens with encrypted format.
Could anyone let me know what could be the problem?