Because msheet could be msheet1, or msheet2 etc If I take the "" away, it comes up with Variable sheet6 is not found
On Thu, May 5, 2016 at 7:02 PM, Allen profox@gatwicksoftware.com wrote:
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").SelectI get an occasional error here
.Selection=foxdata.balance EndifEndscan .ActiveWindow.Close(xlSaveChanges) .Quit() Endwith
-- Kind regards, Sytze de Boer
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]