LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Using excel through vbscript

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VBScript from Excel Amy M Excel Discussion (Misc queries) 4 September 19th 08 09:07 PM
vbscript - export to excel ??? amy_mgfe Excel Programming 0 January 16th 05 01:49 PM
VBScript code behind Excel jjjjj Excel Programming 2 November 23rd 04 10:36 PM
embed excel in ie using vbscript balaji kandan Excel Programming 0 November 22nd 03 09:47 AM
how to kill excel using a vbscript Harald Staff[_4_] Excel Programming 0 July 17th 03 10:02 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"