Excel >> Need a sample or VBA code to open a C# windows forms in Excel using Macro

by dotnetguys » Fri, 03 Feb 2006 22:05:48 GMT

I want to open a windows form which is created in C# using Excel
macros. Can you please anyone suggest me for best website or best way
to proceed?

Thanks in Advance,


Similar Threads

1. Need a sample VB or C# code for aspx that populates pfd forms

2. C# windows form and EXCEL vba question

Hi,

In my C# 1.1 Windows form project, I would like to export record to Excel
2000 spreadsheet Record.xls.
I also need to do some data manipulation in the Record.xls.
How do I call the VBA from my C# windows from project?
Thanks for help.


Jason
 


3. Sample VBA code to open an Visual-Studio-2008-created VBA DLL - Excel

4. issue: calling a C# library function (COMInterop) from an excel macro (VBA)

5. issue: calling a C# library function (COMInterop) from an excel macro (VBA)

6. Need sample code on reading excel data using OLEDB Consumer templa

Here is an example which will import the contents of a sheet into a 
datatable, after which you can do what you want with it. The oledbdatareader 
works in much the same way, but it's not as flexible.

    Function ImportExcelData(ByVal YourExcelFile As String, ByVal SheetName 
As String) As DataTable
        Dim ConnectionStringBuilder As New OleDbConnectionStringBuilder
        Dim Connection As New OleDbConnection
        Dim Adapter As OleDbDataAdapter
        Dim SQL As String
        Dim dtXL As New DataTable

        With ConnectionStringBuilder
            .Add("Provider", "Microsoft.Jet.OLEDB.4.0")
            .Add("Data Source", YourExcelFile)
            .Add("Extended properties", "Excel 8.0; HDR=Yes; IMEX=1")

            SQL = "SELECT * FROM [" & SheetName & "]"

            Adapter = New OleDbDataAdapter(SQL, .ConnectionString)
        End With

        Adapter.Fill(dtXL)

        Return dtXL

    End Function

hth

GC

"Tham" wrote:

> Hi
> 
> Does anyone know how to read the excel data using OLE DB consumer template?
> 
> 
> Regards
> Tham 
> 
> 
> 

7. Need sample code on reading excel data using OLEDB Consumer template

8. C# code needed to open the windows "Open with" dialog

Hi All,

I need C# code needed to open the windows "Open with" dialog

Regards,
Shilpa