473,327 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Dataset reults to excel sheet

Hello,

I am trying to show data in dataset in to an excel
sheet(ASP.NET/VB.NET). I AM DOING THIS ON SERVER(IIS SERVER) WHICH HAS
EXCEL VERSION 9. I COULD ADD REFERENCE TO EXCEL VERSION 9 AND OFFICE
VERSION 10 IN MY PROJECT. I DO NOT HAVE EXC EL VERSION 10 TO WHICH I
CAN ADD REFERENCE (WHICH I THINK IS THE PROBLEM). i AM GETTING THE
ERROR ' REFERENCE TO NULL OBJECT AT THE CODE line
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add(object
excelApp is not create and I am trying to refere it).

My questin are:

1.Do I need to have excel 10 to have this code run.

2.Do I need to have excel 10 on all clients machines(people who are
accesing this page through web page). Or is it just enough to have
excel 10 on the server(iis server).

3.Is there a way that I c an have this code run woth any version of
excel.

4.Is there a diifrent way that I can open excel and show satase reults
in it.

I AM TRYNG SOME THING LIKE THIS:

Dim excelApp As Excel.Application
Dim excelBook As Excel.Workbook = excelApp.Workbooks.Add
'Dim excelBook As NEW Excel.Workbook
'excelBook = CType(excelApp.Workbooks(1), Excel.Workbook)
Dim excelWorksheet As NEW Excel.Worksheet
excelWorksheet = CType(excelBook.Worksheets(1),
Excel.Worksheet)
'Makes Excel invisible to the user until spreadsheet is
populated
excelApp.Visible = False
With excelWorksheet
'Format cell headings
.Range("A1").Value = "Issue Type"
.Range("A1").Font.Bold = True
.Range("A1").ColumnWidth = 200
.Range("B1").Value = "Number of Calls"
.Range("B1").Font.Bold = True
.Range("B1").ColumnWidth = 15
.Range("A2").Value = sDateRange
.Range("A2").Font.Bold = True
.Range("A2").ColumnWidth = 200
For i = 0 To dsIssueType.Tables(0).Rows.Count - 1
.Range("A" & i.ToString + 3).Value =
dsIssueType.Tables(0).Rows(i)("IssueType")
.Range("B" & i.ToString + 3).Value =
dsIssueType.Tables(0).Rows(i)("NumberOfTickets")

Next
.Range("A" & i.ToString + 4).Value = "Total Number of
Calls"
.Range("A" & i.ToString + 4).Font.Bold = True
.Range("A" & i.ToString + 4).ColumnWidth = 200
.Range("B" & i.ToString + 4).Value =
nTotalNumberOfCalls
.Range("B" & i.ToString + 4).Font.Bold = True
.Range("B" & i.ToString + 4).ColumnWidth = 15

excelApp.Visible = True
End With

Thanks a lot
Nov 20 '05 #1
1 1473
Hi Vanajakshi,

When you use interop as you do, than you create a tunnel to your
application.

When you use from that application features, than as far as I know should
that be the features from the existing application.

I hope it helps?

Cor
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet...
1
by: Terry | last post by:
My Question is this, I'm having trouble getting the OleDbDataAdapter to Point to another connection string and pull the data out of the DataSet I created from the Excel Spread Sheet and Place it up...
9
by: Paul | last post by:
Hi all Arggghhh........... The problem.....I want the user to be able to create an excel document and name particular cells in the document where they want the data to be placed and then save...
3
by: yaya via DotNetMonster.com | last post by:
Hi, I'm using OleDb to read an excel files and display the data in a datagrid (using dataset as data source), after modifying the data on datagird, how can I save the changes back into Excel files. ...
7
by: Jake | last post by:
Hi all, I am trying to update an SQL server table from a dataset populated by an excel spread sheet. Each record has a check box so it can be excluded from the SQL server table population. ...
12
by: Ed | last post by:
Hi All, I'm looking for an efficient way of dumping a table in a Dataset into an Excel sheet. I'm currently copying data cell by cell and this is rather inefficient for large Datasets. My...
1
by: Ramakrishnan Nagarajan | last post by:
Hi, I am converting Excel data into a Dataset in C#. There are around 24 columns in the Excel Sheet. First I tried to insert one row with correct values in the Excel sheet. i.e. for text columns...
3
by: Sachin Salgarkar | last post by:
I have a DataSet that I need to export to Excel. The dataset has multiple tables. I need a way to export the complete dataset to a single Excel Workbook with sheets for each table in the dataset....
1
by: =?Utf-8?B?Y29uc3RhbnRpbg==?= | last post by:
I have problem with my code I need to read from Excel worksheet into dataset the problem is in this line oleda.Fill(ds). The data adapter should fill dataSet with data from Excel worksheet but...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.