Microsoft.Office.Core.MsoTriState.msoFalse
(1)
Microsoft.Office.Interop.Graph.Chart
(1)
Windows Server 2003
(1)
MsoTriState.msoFalse
(1)
Slide.Shapes.AddOLEObject
(1)
MSGraph.Chart
(1)
Office 2007
(1)
Windows 7
(1)

HRESULT E_FAIL Exception!

Asked By idreesbutt
19-Jan-10 05:07 PM
Hi,

I am trying to generate a powerpoint presentation in C#. It works well on my
local machine which is running XP. When I run the application on Windows
Server 2003 (our Server) the presentation gives HRESULT E_FAIL when I call
the following code


chart = (Microsoft.Office.Interop.Graph.Chart)slide.Shapes.AddOLEObject
(GetLeft(i), GetTop(i), GetWidth(i), GetHeight(i), "MSGraph.Chart", "",
Microsoft.Office.Core.MsoTriState.msoFalse, "", 0, "", Microsoft.Office.Core.
MsoTriState.msoFalse).OLEFormat.Object;


I have no idea what goes wrong with it on the Server. The PPT is generated
perfectly with all other data (tables, text) shown perfectly! Please help! I
have uninstalled and reinstalled Standard Office 2007 many times now. Ran
Registry cleaner as well. Did alot of google! this is really frustrating!


Please help!

Once the PPT has been created on a working machine, can you view itcorrectly

Paul Shapiro replied to idreesbutt
20-Jan-10 12:38 PM
Once the PPT has been created on a working machine, can you view it
correctly on the server? If the chart does not appear, perhaps the required
features are not installed or registered correctly.

Thank you so much for replying and taking interest in my problem!

idreesbutt via DotNetMonster.com replied to Paul Shapiro
21-Jan-10 04:16 PM
Thank you so much for replying and taking interest in my problem!

The PPT does get generated on the server and viewed! All the slides (tabular
+ textual) are generated very well! but for the chart slides, I get this
exception. However, on my local machine the same code works well!

Your opinion seems to be valid but I wonder how I can check what is missing
and how I can reset everything? I mean I have reinstalled office many times
with every possible combination of steps that made sense to me but nothing
has worked so far! Can you guide me further? Please!


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/vs-net-office/201001/1

I do not think you answered the question- if you take the ppt file that

Paul Shapiro replied to idreesbutt via DotNetMonster.com
21-Jan-10 09:22 PM
I do not think you answered the question- if you take the ppt file that was
generated 100% complete on the workstation, and the charts are visible on
the workstation, to the server, can you see the charts on the server? If
not, the charting component is probably not installed on the server. If yes,
then something is perhaps wrong with the chart component installation on the
server. Is the chart component supported on a server? Is the server being
used as a workstation, with a single logged-on user, or is it a web server
supporting multiple users? Microsoft Office software is specifically not
licensed or supported for use on a web server, and will not work correctly in
that application.

Anyway, it seems that whatever charting component you are using is registered
on the workstation but not on the server. What charting component are you
using?
I apologize if there was any confusion.
idreesbutt via DotNetMonster.com replied to Paul Shapiro
22-Jan-10 11:08 AM
I apologize if there was any confusion.

Actually, once a file is generated successfully on my computer, it does
appear ok everywhere, on the server as well on my local machines. Also, if I
manually create a presentation on server using the same Office (standard
edition), I can create charts and so on. The only issue that I have is when
the deployed code runs on server, it somehow does not recognize the
AddOleObject method. I am using Microsoft Graph for charting (Graph.Chart to
be specific).

Lets say that something is wrong with the installation. Whats the way to fix
it? Cant I just reset everything? I dont think Windows Server 2003 has any
issue with this. To check this however, I am going to run an experiment by
having a fresh local machine with Windows Server 2003 installed on it and
then creating the same environment to see whether the application generates
the charts or not!

There are multiple websites hosted on our server so to answer you question, I
think the answer is that its not being used for a single user!

Please dont get irritated by this but you are the only one responding on my
issue and I look forward to receiving your help in fixing this issue thank
you...


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Forums.aspx/vs-net-office/201001/1
stuck with the same issue
swathi replied to idreesbutt
25-Mar-10 08:00 AM
Hey i had this same issue my code working fine for windowsxp,windows 7 but not working for vista.... any small help is well appreciated... its killing
i had this same issue
swathi replied to idreesbutt
25-Mar-10 08:03 AM
Hey.. i had this same issue my code is working fine for windowsxp,windows7... but not for windows vista... any small sugg.. is well appreciated.... i am testing under 2010 office...
i had this same issue
swathi replied to idreesbutt
25-Mar-10 08:03 AM
Hey.. i had this same issue my code is working fine for windowsxp,windows7... but not for windows vista... any small sugg.. is well appreciated.... i am testing under 2010 office...
Post Question To EggHeadCafe