View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Taras_96 Taras_96 is offline
external usenet poster
 
Posts: 4
Default Error 424 for sample code?

Hi all,

I'm new to VBA programming, and I'm trying to run the code found at:
http://www.microsoft.com/technet/scr.../tips0503.mspx

Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
Set objWorkbook = objExcel.Workbooks.Add()
Set objWorksheet = objWorkbook.Worksheets(1)

objExcel.Cells(1, 1).Value = "Olympia, WA"
objExcel.Cells(2, 1).Value = "Salem, OR"
objExcel.Cells(3, 1).Value = "Boise, ID"
objExcel.Cells(4, 1).Value = "Sacramento, CA"

Set objRange = objExcel.Range("A1").EntireColumn
Set objRange2 = objExcel.Range("B1")

objRange.TextToColumns objRange2,,,,,,TRUE

When I click on run, I get a 424 error, and clicking on debug sends me
to the last line. What is wrong with the code?

Thanks

Taras