Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Andy wrote:
[b]I assume you really mean VBScript and not VBA, so here goes; Here is a sample VBScript. Save it in a standard text file with a .VBS extention. This one creates an Excel object, opens a workbook, sets a value, runs a VBA routine, then tides up and closes down. Set xlObj = CreateObject("Excel.application") xlObj.Workbooks.Open "C:\Byg\textfile\TextFileReformat.xls" xlObj.Range("NoOfCharsPerLine").Value = 50 xlObj.Run "ReadFromTextFile" xlObj.ActiveWorkbook.Saved = True xlObj.ActiveWindow.Close xlObj.Quit [b] Don't forget to Set xlObj = Nothing at the end...... Keith www.kjtfs.com --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening more than 1 Excel Spreadsheet | Excel Discussion (Misc queries) | |||
Can i include a vbscript file with an xml spreadsheet? | Excel Discussion (Misc queries) | |||
Opening Excel spreadsheet in MAC | Excel Discussion (Misc queries) | |||
Opening an excel spreadsheet | Excel Worksheet Functions | |||
VBScript Automation of Excel Spreadsheet Sorting & Filtering | Excel Programming |