You are hereException from HRESULT: 0x800A03EC - Excel, .Net, SQL and Windows Server 2008


Exception from HRESULT: 0x800A03EC - Excel, .Net, SQL and Windows Server 2008


By hagrin - Posted on 16 March 2009

For the last 5 days, I have been encountering an error when trying to automate the creation of an Excel document through a scheduled SQL Server job. The error I was receiving was -

Exception from HRESULT: 0x800A03EC

Let's take a step back. The same code I had written worked on my development machine, worked on other target servers while scheduled as SQL jobs, but the code would not work on the following target server -

  • Windows Server 2008 Standard
  • 64-bit platform
  • SQL Server 2005
  • Excel/Office 2007 Professional

After adding some StackTrace code to my program, I was able to determine that the EXE was failing on the Microsoft.Office.Interop.Excel.WorkbookClass.SaveAs line. After trying multiple iterations of the SaveAs command (a quick Google search provided some potential solutions), I continued to get the same 0x800A03EC error code. I went down the road of thinking it was a problem with my 32-bit development environment and had our Sysadmin build me a 64-bit virtual machine for me to compile my application; however, this also yielded the same error. I made sure that the Excel assemblies on the development environment and the target machine were the same version. On the target server, I went to dcomcnfg, selected the Microsoft Excel Application entry and made sure it was using the "interactive user" and still no luck. I made sure that, for testing only, all the SQL services ran under my domain admin account to account for SQL security differences and still nothing.

At this point I decided that I was spinning my wheels and I would call Microsoft and use one of my MSDN support cases.

After speaking to several departments, I finally reached the Office department who tried to help. After explaining my issue quite a few times over and over, I finally got the response I had dreaded - it can't be done that way. Ugh. I had feared I would get this response after reading that using Open XML to create Office documents was the recommended approach and that using the Office COM references was no longer supported (if it ever was) and Windows 2008 has additional security that prevents the old approach from working properly. Well, I guess that explains why it wasn't working.

So where do I go from here? Even though Microsoft support couldn't provide me with sample code or a link to some code, I was able to find this knowledge base article detailing how to to create Excel files using Open XML. Hopefully, this approach will work on my target server environment.

Medical tourism (also called medical travel, health tourism and global healthcare) is a term initially coined by travel agencies and the mass media to describe the crossing of international borders to obtain health care fast-growing practice.Multicolour Dress It also refers to derogatory international travel health care providers to provide health care practices.

Usually seek passenger services include elective procedures as well as complex specialized surgeries such as knee / hip arthroplasty (), cardiac surgery, dental surgery and cosmetic surgery. However, almost all types of health care, including psychiatry, alternative treatments, rehabilitation care, and even burial services.One Shoulder Dresses As a practical matter, suppliers, and customers often use non-formal channels of communication connection contract, in this case, which often means less regulatory or legal oversight to assure quality and less formal recourse compensation or remedy, if necessary, [citation needed].

More than 50 countries have identified medical tourism as a national industry. [3] However, accreditation and other measures of quality vary widely across the globe,Signature Stretch Satin Dress there are certain risks and ethical issues that make this method of accessing medical care controversial [citation needed]. In addition, some destinations may become hazardous, even dangerous for medical tourists to consider.

In the context of global health, "medical tourism" is a pejorative, because in such a travel health care providers often practice outside of their areas of expertise, or have a different standard of care (ie, low). Greater numbers than ever before student volunteers, medical professionals trainees, and from the resource-rich countries, researchers,cheap skirts temporary work, and look forward to future work in resource-poor regions [5] [6]. This emphasizes the importance of understanding this definition....123

Year 2013 is coming,the end of world(20/12/2012) was gone.We still live.
2013 Yamaha Jet Ski Sale is listing now.We can supply the newest 2013 brand new
and genuine Yamaha jet ski,Kawasaki Jet Ski Sale and Sea doo jet ski Sale with competitive
price.The jet ski come with the trailer,cover and vest.
Jet Ski For Sale, Kawasaki Jet Ski and Sea Doo Jet Ski are very popular all over the
world,especially European,Austrilia and USA.
With jet ski,we can take waves stayed the speeding boats.We can communicate with
the sea.
It’s a sunshine sport for every one who love sea.
We can supply signal seat super 3 or 4 seats for the driver.
We also can supply the best Yamaha Jet Boat and Sea Doo Jet Boat.
It’s great to go with your girl friend to drive the jet boat on the sea.
It’s romantic.
2013 Kawasaki Ultra 300X is well-know by every one who love jet ski.
It’s a great one,the same as Sea Doo Jet Ski..
We can supply the factory price and shipping free for you.

http://www.ncoachoutlet.com/ coach outlet coach outlet online usa
http://www.smichaelkorsoutlet.com/ michael kors outlet usa michael kors purses
http://www.new-michaelkorspurses.com/ michael kors purses outlet online
http://www.mk-michaelkoroutlett.com/ michael kors outlet stpre
http://www.guccishoeoutletfactory.net/ gucci shoes outlet online
http://www.northfacenoutletonline.net/ north face jackets outlet online
http://www.monstervheadphones.com/ monster beats outlet online
http://www.coach-storesonline2013.net/ coach outlet store online

For those of us with Suzuki Outboards Sale a reasonable fear of the ocean, this is a worst case scenario: Last week, Dan Suski, 30, and his sister Kate Suski, 39, chartered a fishing boat in St. Lucia. Things were going fine, despite the rough seas, and the siblings even managed to hook a 200-pound marlin. They were battling the giant fish when water rushed onto the boat and flooded its engine room. As the captain radioed for help, another surge Yamaha 4 Stroke Outboard of water swamped the boat. At that point, the captain tossed the Suskis life jackets and ordered them into the ocean.
"He said, 'Jump out! Jump out!'" Kate Suski recalled in a telephone interview Thursday with The Associated Press.
The captain and the first mate soon joined them and Yamaha 150 outboard, five minutes later, the boat sank, leaving the group stranded at least eight miles from shore. The group stayed put for the first hour, awaiting rescue. No one came. The group started to swim, but the rough waves caused the Suskis to became separated from the captain and first mate. "We would just see swells and gray," Dan Suski said.
Hours went by. A helicopter and search plane arrived but failed to notice the two siblings. They continued swimming. Eventually, the sun went down.
"There's this very real understanding that the situation is Yamaha outboard motors dire," Kate Suski said. "You come face-to-face with understanding your own mortality ... We both processed the possible ways we might die. Would we drown? Be eaten by a shark?"
Neither could stop thinking about sharks. "I thought I was going to vomit I was so scared," Kate said.
Finally, after 14 hours, they came within 30 feet of land only to discover the coast was covered with cliffs, making it impossible to climb from the ocean. “We knew we would get crushed,” Kate said.
They kept swimming, Yamaha outboards Sale finally finding a small stretch of sand. Once ashore, they collapsed before again going into survival mode to avoid hypothermia. They hiked into the island and huddled together, covering themselves in grass and brush to stay warm. They spent the night like that, only moving when the sun rose. It took three hours before they found a farmer, who called police and gave them water and crackers.
They would later find out that the captain and first mate had been rescued after 23 hours in the ocean.
Despite dehydration, severe tendonitis and Honda outboards Sale cuts over their feet and back, the couple didn't blame anyone for the ordeal.
"We are so grateful to be alive right now," Kate Suski said. "Nothing can sort of puncture that bubble."

1. Login to the server as a administrator.
2. Go to "Start" -> "Run" and enter "taskmgr"
3. Go to the process tab in task manager and check "Show Processes from all
users"
4. If there are any "Excel.exe" entries on the list, right click on the
entry and select "End Process"
5. Close task manager.
6. Go to "Start" -> "Run" and enter "services.msc"
7. Stop the service automating Excel if it is running.
8. Go to "Start" -> "Run" and enter "dcomcnfg"
9. This will bring up the component services window, expand out "Console
Root" -> "Computers" -> "DCOM Config"
10. Find "Microsoft Excel Application" in the list of components.
11. Right click on the entry and select "Properties"
12. Go to the "Identity" tab on the properties dialog.
13. Select "The interactive user."
14. Click the "OK" button.
15. Switch to the services console
16. Start the service automating Excel
17. Test you application again.

Hi,
i am getting this exception for the below line

OLEObject CustomerTableListBox= woorkSheet.OLEObjects("CustomerTableListBox");
CustomerTableList is an OLEObject in my Excel sheet.

I using Visual studio 2012 and Office 2010.

So, i was trying the above solution but i did not found
automating Excel and Microsoft Excel Application

Thanks for this solution. it works!!!

Thanks.

With the help of your article my problem gets resolved

I am glad this solution has worked for so many people. I ran according to instructions, and I don't show a "Microsoft Excel Application" listed in my available list of components. I ended up writing a kluge, in which I created a new directory and used the SaveCopyAs clause of the workbook to make a duplicate entry with the same file name. At that point, I can copy the files back over. Good thing these are not humongous files and the changes are relatively minor, that don't take much time. I using Windows 7 enterprize, Service Pack 1, and I wonder if Excel is called something else in this setup. As far as I can tell, "DCOM Config" has no hidden components.

Strange. Glad to know some are getting relief. Would be curious if anyone else has the same difficulty I do.

You are supper . Thank thank thank....
It took me 2 days to search this problem.
Thank you very much

u really saved my second day cause it was running fine while i debug it but after hosting in iis was giving trouble thanks a lot have g8 day
enjoy coding

With above solution , i can import/exprot files if i save that file and directly import.but if i say open in broadcasted file
(code for reference :
window( Response.AddHeader("content-disposition", "attachment;filename=Export.xls");
Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";)

in excel 2007 then it is saying that not proper formate and if i say yes to open it will open correclty but when i import it it is throwing com error.
this works perfact in excel 2003.

What changes do i need to do to make it working in Excel 2007 ?

Yes, Interacting user solve my problem alone with adding more security users(permissions) and downloading CutePDF to make (xlWorkBook.ExportAsFixedFormat()) as PDF work:

I know this post is a little old, but this might help someone:

Select Case (extension)
Case ".pdf"
contentType = "application/pdf"
Case ".xls"
contentType = "application/vnd.ms-excel"
Case ".xlsx"
contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet "
Case ".doc"
contentType = "application/msword"
Case ".docx"
contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
Case ".txt"
contentType = "text/plain"
Case ".csv"
contentType = "application/octet-stream"
Case ".png"
contentType = "image/png"
Case ".jpg"
contentType = "image/jpeg"
Case ".jpeg"
contentType = "image/jpeg"
Case ".gif"
contentType = "image/gif"
Case Else
Throw New NotSupportedException("Unrecognized file type.")
'contentType = "application/octet-stream"
End Select

I'd have to debug the code to determine what the issue is. I have had no problems with Office 2007 products.

Selecting "The interactive user" solved my proble.
I have invested 1 and half day almost to resolve the issue and i was disappointed with all the solution found by googling..this is the one wich solve my proble.Thanks very much.I want to understand why this setting is neccessary..if anybody can reply.

Thanks a lot. Your solutions worked like a charm.
Actualy my problem was on this line code:

execute @rs = master.dbo.sp_OAMethod @xlWorkBooks, 'Open', @xlWorkBook OUTPUT, 'D:\itWorks.xls'

But @rs returned the same error

thanks a lot

I'm going to test this solution over the next few days and see if this also solves my problem. Thank you very much for the very detailed comment.

I ran into exactly the same problem. Running from a console window worked fine, running from a SQL job failed at the "SaveAs". I also beat my head against the wall for awhile. Then I noticed "SaveCopyAs" and figured...what'd I have to lose?

SUCCESS!!

Of course, this will be "fixed" in a "future releas/service pack"! :-(

Don

My code has problem on "Open" and there's no "OpenCopy" or anything :(

That actually sounds like a different problem - as if the file is already locked by the OS. Make sure that the file isn't being held open by a previously crashed process or improperly closed stream.

i had the same problem but it works using SaveCopyAs and thanks for this article