List Info

Thread: C-Sharp (C#) Group: Microsoft.Office.Interop.Excel Texttocolumns C#




C-Sharp (C#) Group: Microsoft.Office.Interop.Excel Texttocolumns C#
country flaguser name
United States
2007-04-06 16:33:21
I am new to C# and I am trying to convert this vba code to
C#:

Columns("A:A").Select
    Selection.TextToColumns
Destination:=Range("A1"),
DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False,
Tab:=False, _
        Semicolon:=False, Comma:=True, Space:=False,
Other:=False,
FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1),
Array(4, 1),
Array(5, 1), Array(6, 1), _
        Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1),
Array(11,
1), Array(12, 1), Array(13, 1 _
        ), Array(14, 1), Array(15, 1), Array(16, 1),
Array(17, 1),
Array(18, 1)), _
        TrailingMinusNumbers:=True

I came up with this:

                aRange =
excelWorksheet.get_Range("A1",
Missing.Value);
                aRange.TextToColumns("A1",
Excel.XlTextParsingType.xlDelimited,
                   
Excel.XlTextQualifier.xlTextQualifierDoubleQuote,
false, false, false, true, false, false,
                    false, false, false, false, true);

I get an error with the range. I can find several vb
examples of this
but no c# using the interop.

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://g
roups.google.com/group/C_Sharp?hl=en
-~----------~----~----~----~------~----~------~--~---


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )