Running an ASP.NET application that uses Excel on a Windows Server
I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.
When I deploy the application on my server and run it, I am getting the following exception :
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.
Does anyone have a solution?
c# asp.net excel
add a comment |
I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.
When I deploy the application on my server and run it, I am getting the following exception :
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.
Does anyone have a solution?
c# asp.net excel
3
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
1
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20
add a comment |
I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.
When I deploy the application on my server and run it, I am getting the following exception :
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.
Does anyone have a solution?
c# asp.net excel
I have developped an asp.net application using microsoft office interop excel on my local machine, everything worked well, an excel file was build.
When I deploy the application on my server and run it, I am getting the following exception :
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046}
failed due to the following error: 80040154 Class not registered
(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
I have done some research on forums, I know that it's probably because excel is missing on the server, however I am not able to find an appropriate solution, knowing that install excel on the server is not really possible. And also knowing that I would like to keep interop as my library.
Does anyone have a solution?
c# asp.net excel
c# asp.net excel
edited Nov 20 '14 at 14:26
Patrick Hofman
126k18170224
126k18170224
asked Nov 20 '14 at 14:13
user2443476user2443476
90552047
90552047
3
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
1
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20
add a comment |
3
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
1
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20
3
3
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
1
1
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20
add a comment |
1 Answer
1
active
oldest
votes
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27041692%2frunning-an-asp-net-application-that-uses-excel-on-a-windows-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
add a comment |
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
add a comment |
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
First, what ever you are trying to do, try to do it without using Excel (or any Office) interop in ASP.NET. Microsoft strongly discourages it, as it might not work as you expect.
There are plenty possibilities to do this without the 'client application' Excel, for example EPPlus.
Second, the problem with your code is the lack of Office installed or the wrong version of Office (also consider 32- or 64-bit platform versions).
edited Nov 20 '14 at 14:29
answered Nov 20 '14 at 14:22
Patrick HofmanPatrick Hofman
126k18170224
126k18170224
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f27041692%2frunning-an-asp-net-application-that-uses-excel-on-a-windows-server%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Office interop requires that office be installed on the machine that code is running on, your code just won't work without it.
– Ben Robinson
Nov 20 '14 at 14:17
1
Also depending on the server OS, there may be many hoops to jump through to get Excel to actually start properly when called. Windows 2012 is particularly buttoned down and we could only get it to work with logging into the box as the service user. Which is not good and led us to use another solution for working with Excel files.
– dbugger
Nov 20 '14 at 14:20