| View previous topic :: View next topic |
| Author |
Message |
Jeremiah
Joined: 20 Apr 2009 Posts: 797 Location: North Dakota, USA
|
Posted: Fri Jan 29, 2010 7:55 pm Post subject: FileAppend With Excel Doesn't Work |
|
|
I am having trouble getting this to work. So far, the script does create the file "test.xlsx" and opens it, but for some reason Excel doesn't like it. Any thoughts?
| Code: | FileAppend, , C:\test.xlsx
Run C:\test.xlsx |
I have also tried this with putting in some text too, but it still doesn't work.
Thank you in advance! _________________ -Jeremiah |
|
| Back to top |
|
 |
Jeremiah
Joined: 20 Apr 2009 Posts: 797 Location: North Dakota, USA
|
Posted: Fri Jan 29, 2010 9:08 pm Post subject: |
|
|
Anyone? _________________ -Jeremiah |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Fri Jan 29, 2010 9:27 pm Post subject: |
|
|
I use:
FileAppend,`n%var% `, %var% `, %var% , C:\path\path\ExcelDocuments.csv
the `, is for the comma, as 'CSV' is comma seperated variables, and inputs values into the different columns.
the csv files open with XLS. |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
Posted: Fri Jan 29, 2010 9:51 pm Post subject: |
|
|
Excel files are binary files which you can deal with in AHK as such (you can but you don't want to go there). FileAppend works for text files, like CSV for example. So you could export your Excel file to CSV and add data to it via the fileappend command but it won't work for XLS files.
If you do want to work with Excel files directly you need to look into COM
http://www.autohotkey.com/forum/viewtopic.php?t=31923 _________________ AHK Wiki FAQ
TF : Text files & strings lib, TF Forum |
|
| Back to top |
|
 |
answer4u Guest
|
Posted: Fri Jan 29, 2010 9:53 pm Post subject: |
|
|
| Jeremiah wrote: | | I am having trouble getting this to work. So far, the script does create the file "test.xlsx" and opens it, but for some reason Excel doesn't like it. Any thoughts? |
Try opening a .xlsx file with notepad and you might see why . As Carcophan pointed out, you could convert these files to .csv files, or you could open them with excel to append. |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 8255 Location: Maywood, IL
|
Posted: Fri Jan 29, 2010 11:08 pm Post subject: |
|
|
xlsx files are actually zip files. One of the better MS standards is the zip container file formats. Rename an xlsx file to .zip, then open it up and have a look. inside you can find all your data in xml format, though it's not always easy to read.
as far as making files, csv is really the right way to go. any spreadsheet program will read it, and all your data will import cleanly.
remember to put "" around text fields. commas inside " are read as commas and not column separators. _________________
(Common Answers) |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Fri Jan 29, 2010 11:22 pm Post subject: |
|
|
| engunner wrote: | | Rename an xlsx file to .zip, then open it up and have a look. inside you can find all your data in xml format, |
...wow
Neat trick, had absolutly NO idea that was even possible. |
|
| Back to top |
|
 |
|