Click here to Skip to main content
16,005,120 members
Home / Discussions / C#
   

C#

 
AnswerRe: .NET DashBoard Pin
DaveyM6920-May-09 23:26
professionalDaveyM6920-May-09 23:26 
GeneralRe: .NET DashBoard Pin
AmmySA21-May-09 0:23
AmmySA21-May-09 0:23 
QuestionTime Difference calculator Pin
RogerLum20-May-09 22:07
RogerLum20-May-09 22:07 
AnswerRe: Time Difference calculator Pin
musefan20-May-09 22:10
musefan20-May-09 22:10 
AnswerRe: Time Difference calculator Pin
Simon P Stevens20-May-09 22:46
Simon P Stevens20-May-09 22:46 
QuestionHow to change the body tag attributes in c# using ? Pin
svt gdwl20-May-09 21:09
svt gdwl20-May-09 21:09 
AnswerRe: How to change the body tag attributes in c# using ? Pin
Mycroft Holmes20-May-09 21:15
professionalMycroft Holmes20-May-09 21:15 
QuestionMicrosoft.Office.Interop.Excel.Application issue [modified] Pin
AndieDu20-May-09 20:56
AndieDu20-May-09 20:56 
Hi All,

sorry guys i have to rewire my question.

I am using Microsoft.Office.Interop.Excel.Application COM to create a Excel spreadsheet, and write the value (not from any dataset) into that spreadsheet, and then StreamWrite to the disk.

For some reason, the following code is not working.

This is the declaration of ws:
Microsoft.Office.Interop.Excel.Worksheet ws =(Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets[1];

ws.Cells[1, 1] = "CardNo";
ws.Cells[1, 2] = "PharmacyName";
ws.Cells[1, 3] = "CostPerCard";

sw.Writer(ws.Cells[1, 1]);
sw.Writer(ws.Cells[1, 2]);
sw.Writer(ws.Cells[1, 3]);

I thought this code will write to the spreadsheet like this:
A | B | C
-----------------------------------------------
CardNo | PharmacyName | CostPerCard

but, it wrote to spreasheet like this, all them just in column A:
A
-----------------------------------------------
System.__ComObjectSystem.__ComObjectSystem.__ComObjectH40655


I have been spent quite lots of time on it, but still couldn't work it out.

Thanks heaps

modified on Thursday, May 21, 2009 6:32 AM

AnswerRe: Microsoft.Office.Interop.Excel.Application issue Pin
MumbleB20-May-09 21:40
MumbleB20-May-09 21:40 
GeneralRe: Microsoft.Office.Interop.Excel.Application issue Pin
AndieDu21-May-09 0:09
AndieDu21-May-09 0:09 
AnswerRe: Microsoft.Office.Interop.Excel.Application issue Pin
AmmySA20-May-09 22:38
AmmySA20-May-09 22:38 
GeneralRe: Microsoft.Office.Interop.Excel.Application issue Pin
AndieDu21-May-09 0:08
AndieDu21-May-09 0:08 
AnswerRe: Microsoft.Office.Interop.Excel.Application issue Pin
AndieDu21-May-09 17:28
AndieDu21-May-09 17:28 
AnswerRe: Microsoft.Office.Interop.Excel.Application issue Pin
AmmySA22-May-09 5:39
AmmySA22-May-09 5:39 
GeneralRe: Microsoft.Office.Interop.Excel.Application issue Pin
AndieDu22-May-09 16:14
AndieDu22-May-09 16:14 
QuestionC# calling unmanaged C/C++ COM method with C++ reference type Pin
Klempie20-May-09 20:44
Klempie20-May-09 20:44 
AnswerRe: C# calling unmanaged C/C++ COM method with C++ reference type Pin
Klempie21-May-09 2:54
Klempie21-May-09 2:54 
GeneralRe: C# calling unmanaged C/C++ COM method with C++ reference type Pin
Klempie21-May-09 3:50
Klempie21-May-09 3:50 
QuestionSystem font scripts Pin
fungweizz20-May-09 20:38
fungweizz20-May-09 20:38 
AnswerRe: System font scripts Pin
Baran M20-May-09 21:00
Baran M20-May-09 21:00 
GeneralRe: System font scripts Pin
fungweizz20-May-09 21:55
fungweizz20-May-09 21:55 
QuestionVery urgent please Pin
Naveed72720-May-09 20:28
Naveed72720-May-09 20:28 
AnswerRe: Very urgent please Pin
Mycroft Holmes20-May-09 21:22
professionalMycroft Holmes20-May-09 21:22 
GeneralRe: Very urgent please Pin
Naveed72720-May-09 21:30
Naveed72720-May-09 21:30 
GeneralRe: Very urgent please Pin
Mycroft Holmes20-May-09 21:45
professionalMycroft Holmes20-May-09 21:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.