why have you got "" as well as & ? Al
-----Original Message----- From: Sytze de Boer Sent: Thursday, May 5, 2016 2:09 AM To: profoxtech@leafe.com Subject: VFP to XLSX file
I just can't figure what I'm doing wrong with this code. Can anyone assist The spreadsheet I want to place information into has about 15 Sheets Foxdata has around 500 entries
With loExcel .Workbooks.Open(lcFile) Scan Select foxdata If !balance=0 Mdata =Alltrim(foxdata.sheet2) && EG "J16" *Msheet="SHEET"+ALLTRIM(sheet1) && EG "Expenses" Msheet="SHEET"+ALLTRIM(STR(sheetnum)) && If I use the sheet number instead .Sheet("&msheet").Select This is where it comes up with error "invalid index"
.Range("&Mdata").Select I get an occasional error here
.Selection=foxdata.balance Endif
Endscan .ActiveWindow.Close(xlSaveChanges) .Quit() Endwith