General information
Category:
Coding, syntax & commands
Hello again Sergey
I hope you have nice holidays
On your code that you send to me and work fine , i need to make some modification, because i need to change some value to return my calculate field Cell C14 and what i want is after closing my excel workbook , i use this value field to make a replace for example on my VFOX application.
my code is :
oExcel = CreateObject("Excel.Application")
*Caminho e nome do ficheiro
oWorkbook = oExcel.Workbooks.Open("f:\aaa.xls")
*Nome Da Folha
oSheet = oWorkbook.Sheets("aaa")
*Activate selected sheet
oSheet.Activate()
*Make Excel visible
oExcel.Visible = .T.
*Get value from a cell with some formula
lnSum = oSheet.Cells(12,"c").Value
msg(astr(lnsum))
select lr
replace lr.u_nrchpd with astr(lnsum)
*oSheet.deactivate()
oWorkbook.close
How can change my code to keep the value "lnsum", but only when i close my Excel workbook. I try with :
oExcel = CreateObject("Excel.Application")
*Caminho e nome do ficheiro
oWorkbook = oExcel.Workbooks.Open("f:\aaa.xls")
*Nome Da Folha
oSheet = oWorkbook.Sheets("aaa")
*Activate selected sheet
oSheet.Activate()
*Make Excel visible
oExcel.Visible = .T.
if oWorkbook.close
*Get value from a cell with some formula
lnSum = oSheet.Cells(12,"c").Value
msg(astr(lnsum))
select lr
replace lr.u_nrchpd with astr(lnsum)
oWorkbook.close
endif
But VFPRO return error : " Member CELLS does not evaluate to an object"
Could you give me some help
Many thanks again
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only