[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Excel Files



> We are currently creating ascii files with a ";" delimiter to get our
> files in to an Excel Spreadsheet.  We are creating an .lis and then the
> user is opening that .lis in Excel.  I am curious to know if there is
> anyone out there that has automated the process of creating the file and
> taking it in to Excel without user intervention.

I'm not sure how much user intervention you are willing to tolerate, but if
you create your output file with commas instead of semicolons (and quotes
around string values so that commas in the strings don't cause trouble), you
can simply open the file in recent versions of Excel and it will be imported
automatically.

In fact, its been my experience Office 95/97 automatically registers the
extension ".csv" to Excel, so that if your file names end in that extension,
you can simply double-click on them from Windows Explorer and Excel will
open them up.

If you are then trying to save the spreedsheets in native Excel format, you
do have to "intervene" a little.  I forget if you have to give a new file
name or just click on a "Save in Excel format" button.  In any case, you
could probably work out a macro in Excel to further automate the process.

If you are trying to have Excel fired up automatically when your program
finished running (and you are running SQR on your Windows box), then you
could probably use "call system using" to invoke Excel, passing it the name
of the file you want to open.  (You may need to be sure SQR has closed the
file first by using "new-report".) In Windows 95, you can even just give the
command "START xxx.CSV", and it will automatically start the application
registered to .CSV and tell it to open the given file.  (I haven't tried
this with Excel, but it's worked well with other programs.)

                                                        Nathan

p.s. Excel may actually accept semicolons instead of commas; I've never
looked into that.

----------------------------------------------------------------------------
Nathan Treadway    | Ray Ontko & Co. | info@ontko.com (auto-reply server)
nathant@ontko.com  | Richmond, IN    | ftp.ontko.com, http://www.ontko.com/