inserting a column in excel from vb6

spumbu1977

New Member
Joined
Dec 28, 2005
Messages
16
hi all,

i am trying to add a column intoi my excel spreadsheet during my apps runtime

so far i have is the follwing

Dim Ex As Object
Dim ws As Object
Set Ex = CreateObject("Excel.Application")
Ex.Workbooks.Add ("c:\text.xls")

Set ws = Ex.Worksheets(1)

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


Ex.Visible = True

but it tells me object not supported on the folowing line : ws.Selection.EntireColumn.Insert

anyone have any ideas

thanks in advance
ROb
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi Rob,

How about something like this ...



New postPosted: Mon Jul 03, 2006 12:55 pm Post subject: inserting a column in excel from vb6 Reply with quote Edit/Delete this post Delete this post View IP address of poster Report Post
hi all,

i am trying to add a column intoi my excel spreadsheet during my apps runtime

so far i have is the follwing

Code:
Dim Ex As Object, wb As Object, ws As Object
Set Ex = CreateObject("Excel.Application")
Set wb = Ex.Workbooks.Add
Set ws = wb.Worksheets(1)
ws.Range("f3").EntireColumn.Insert
Ex.Visible = True

Also, can you not set a reference to the Excel Object Library in your project?
 
Upvote 0

Forum statistics

Threads
1,224,938
Messages
6,181,870
Members
453,068
Latest member
DCD1872

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top