Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to export a text file into excel using vbscript I am facing some problem in running OpenText mathod. The code is Dim oXl, strFile2Open, strFile2Save 'File to open. strFile2Open = "H:\TEAM Members files\Herbert Abana\Txts\RentSCMoto0000011.Txt" 'The opened file will be saved with a different extension. strFile2Save = "H:\TEAM Members files\Herbert Abana\Txts\RentSCMoto0000011.xls" 'Initialize Excel instance. Set oXl = WScript.CreateObject("Excel.Application") 'Make Excel visible. oXl.Visible = True oxl.Columns("A:A").Select Call oxl.Workbooks.OpenText( _ strFile2Open ,2 , 1,2 , (Array(Array(0, _ 1), Array(6, 1), Array(12, 1), Array(21, 1), Array(31, 1), Array(39, 1), Array(56, 1), Array _ (63, 1), Array(72, 4), Array(82, 1), Array(83, 1), Array(85, 1), Array(91, 1), Array(108, 1) _ , Array(118, 1), Array(127, 1), Array(132, 4))) It is giving me sytax error on OpenText mathod. I have tried all sorts of things but I am unable to resolve. Can someone help!!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run VBScript from Excel | Excel Discussion (Misc queries) | |||
vbscript - export to excel ??? | Excel Programming | |||
VBScript code behind Excel | Excel Programming | |||
embed excel in ie using vbscript | Excel Programming | |||
how to kill excel using a vbscript | Excel Programming |