.NET Framework - 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!
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)
  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.
  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
  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?
  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
  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
  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...
  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...
help
1) Microsoft.PowerShell.Security.resources (1) Microsoft.PowerShell.ConsoleHost (1) System.Management.Automation.resources (1) Windows XP (1) In message <1194565205.518301.302920@t8g2000prg.googlegroups.com> , Fred J. <swim.instructor@gmail top, searched for PowerShell and deleted all relevant keys. Next remove the bianaries from C: \ WINDOWS \ system32 \ windowspowershell. Then try re-installing V1. If this works, you should now be able Security Have you installed a service pack since you installed powershell v1.0? - -e.g. windows 2003 sp2? since powershell is technically delivered as a hotfix, a service pack placed on 11 / 06 / what-s-new-in-ctp-of-po = wershell-2-0.aspx . = 2E.Uninstalling Windows PowerShell 1.0 = B7 Windows XP-SP2 and Windows Server 2003: Under Add / Remove Program, select the option to show updates. Remove the PowerShell applicable for your system: KB926139 (en-us), KB926140 (localized), KB926141 (MUI pack). . . I am running Windows-XP so I changed your query and got this response; PS > gwmi Win32_QuickFixEngineering | ?{$_.HotFixID -like 'kb9261*'} Description : Windows PowerShell(TM) 1.0 FixComments : HotFixID : KB926139 Install Date : InstalledBy : InstalledOn : Name : ServicePackInEffect : SP3 Status
KB953297 .NET Framework Microsoft NET-Framework 1.1 Service Pack 1, Sicherheitsupdate f??r Windows 2000, Windows XP, Windows Vista, Windows Server 2008, Windows 7 und Windows Server 2008 R2 (KB953297) Hallo Experten, das Sicherheitsupdate KB953297 l????t sich bei mir leider helfen? Viele Gr????e J??rgen .NET Framework - German Discussions NET Framework 1.1 (1) Windows Server 2008 R2 (1) Windows XP (1) Windows Server 2008 (1) Windows Vista (1) Windows 7 (1) Tool (1) Pack
Framework Ciao a tutti, ho sempre avuto questo dubbio e mi piacerebbe togliermelo :-) I vari Windows NT Windows 98 Windows 2000 Windows XP Windows Vista Windows Seven In che linguaggio sono stati scritti? Spero che la domanda non sia stupida. Grazie MV. VB.NET - Italian Discussions SQL Server (1) SalutiVITRIOL (1) Windows XP (1) Windows Vista (1) UGIdotNET (1) Office (1) Le (1) Curiosità (1) MV ha scritto: Quasi tutto