Re: Excel Worksheets by Paul
Paul
Wed Aug 29 13:18:25 CDT 2007
"JayJ" <JayJ@discussions.microsoft.com> wrote in message
news:B09A2714-C592-4DA2-9081-94F764F21C89@microsoft.com...
>I am trying to have a script loop through a list of servers in a text file
> and output information for each server in one Excel file on seperate
> worksheets for each server. I am having trouble finding the info on how to
> do
> this. Right now the script I have is reading from the text file and
> opening a
> new excel instance and new file for each server.
>
> Any help is appreciated.
Hi, Jay
I'm not exactly clear on how far you have gotten on this project.
I think it is possible to do all the Excel stuff without instantiating
Excel, because the ADO object is capable of creating, reading, writing,
modifying, and applying SQL statements to extract information from Access,
Excel, CSV, and other database and spreadsheet type of files.
On Wednesday, August 22, 2007 5:29 AM,
Jeremy Schubert posted a request titled
'Convert CSV file to multiple worksheets'
in this newsgroup.
In one thread of responses, ekkehard.horner provided a script that does
three things, each of which uses ADO (installed as part of the OS with most
recent Microsoft OS versions):
1) Uses SQL statements to extract info from a .MDB (Access database file) to
a .CSV (comma separated value text file).
2) Uses SQL statements to extract info from the .CSV file, storing the info
in VBScript arrays.
3) Uses SQL statements to extract info from the .CSV file and VBScript
arrays, putting the info into separate worksheets in a single .XLS file.
I think it would be fairly easy to turn parts of Ekkehard's script into
functions or subroutines which can do actual building of the .XLS file, so
that you just need a way to get the server info into a series of .CSV files.
Who knows? Maybe a single SQL statement could extract the info using WMI
and build the necessary worksheet in a .XLS file.
-Paul Randall