Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Inserting column in Excel using VB 6 ?

How can I insert column in Excel using VB 6 ?
I write this code, but it does not work properly.
Can anyone help me? :confused:
Private Sub Command1_Click()

Dim Ex As Object
Dim ws As Object
Set Ex = CreateObject("Excel.Application")
Ex.Workbooks.Add (App.Path & "\test.xlt")

Set ws = Ex.Worksheets(1)

ws.Range("I3").Select
ws.Selection.EntireColumn.Insert


Ex.Visible = True

End Sub
[548 byte] By [alexlex] at [2007-11-11 7:38:21]
# 1 Re: Inserting column in Excel using VB 6 ?
The code should insert a column before the currently selected column. What is it that isn't working for you?
pclement at 2007-11-11 17:26:38 >
# 2 Re: Inserting column in Excel using VB 6 ?
VB 6 says than object does not support this method.

but thanks, I alrady find answer. :D
alexlex at 2007-11-11 17:27:39 >