470,588 Members | 2,073 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,588 developers. It's quick & easy.

Export dataset to excel

77
Hi all,
I want to export dataset to Excel and I get an error when I run this code:
Expand|Select|Wrap|Line Numbers
  1.   For h = 2 To ds.Tables(0).Rows.Count
  2.                 For j = 0 To ds.Tables(0).Columns.Count - 1
  3.                     k = 0
  4.   Excel.Cells(h, j) = IIf(ds.Tables(0).Rows(k).Item(j).ToString = "", "-", ds.Tables(0).Rows(k).Item(j).ToString)
  5.                     k = k + 1
  6.  
  7.                 Next
  8.             Next
The error is:
Exception from HRESULT: 0x800A03EC
What is wrong with this code:
Sep 4 '08 #1
1 1144
Curtis Rutland
3,256 Expert 2GB
Maybe this KB article will help.
http://support.microsoft.com/kb/282830/
Sep 4 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Hans [DiaGraphIT] | last post: by
1 post views Thread by Kevin Blakeley | last post: by
4 posts views Thread by John Z. | last post: by
3 posts views Thread by Sachin Salgarkar | last post: by
4 posts views Thread by =?Utf-8?B?anAybXNmdA==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.