|
-
Apr 12th, 2004, 09:24 AM
#1
Thread Starter
Fanatic Member
excel
Hi everyone,
The following code is in vb.net which simply opens a new instance of excel and places data into the cells of the sheet of the excel.
Can someone please send me a C# version of this?
Thanks
Dim oExcel As New Excel.Application
Dim oWorkBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
private sub PopulateExcel()
Dim oRng As Excel.Range
oWorkBook = oExcel.Workbooks.Add
oSheet = oWorkBook.ActiveSheet
oExcel.Visible = True
With oSheet
.Range("A1").Value = "ID"
.Range("A1").Font.Bold = True
.Range("B1").Value = "First Name"
.Range("B1").Font.Bold = True
End With
end sub
-
Apr 12th, 2004, 02:39 PM
#2
Since I don't use C# for automating other applications, I can't convert it. However, you can use VB code in C#. The CLR (CORBA?) lets you write code in a .NET language, and use it in another .NET language. You should also read about this, as it can come in handy later.
Phreak
Last edited by «°°phReAk°°»; Apr 12th, 2004 at 02:47 PM.
Visual Studio 6, Visual Studio.NET 2005, MASM
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
|