|
-
July 25th, 2012, 12:06 PM
#1
[RESOLVED] [VS2010] Excel Worksheet Issues
Hey guys,
So I've a program that is exporting an excel document. I have two different issues with this:
1. I need to add a worksheet
2. I need to delete the default worksheets (I have some code for this one but it returns a COM error)
Can somebody please point me in the right direction with this? I've been searching the net but the way the person that started my application is different from the ways that everybody else seems to be doing it.
Thanks in advance.
-
July 25th, 2012, 12:57 PM
#2
Re: [VS2010] Excel Worksheet Issues
 Originally Posted by S_John
1. I need to add a worksheet
I figured this one out by fooling around with my application some more. --Palm to forehead--
-
July 25th, 2012, 01:18 PM
#3
Re: [VS2010] Excel Worksheet Issues
oWkBk.Sheets("Sheet1").Delete()
This is the error I receive when I try to run the code line above:
"COM object that has been separated from its underlying RCW cannot be used."
-
July 26th, 2012, 06:36 AM
#4
Re: [VS2010] Excel Worksheet Issues
Are you disposing excel's objects before the call to delete the sheet?
-
July 26th, 2012, 08:13 AM
#5
Re: [VS2010] Excel Worksheet Issues
Dear Hannes,
I would like a clone of you to be peering over my shoulder so that you could smack me in the back of the head every time I make a stupid mistake.
I was releasing the objects before my call to delete the sheet (the code is a bit messy...I should probably clean it up so I don't waste others' time)
Thanks again for saving my hide,
Seth
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|