Dear Expert,
How would I insert RTF value in Excel worksheet, Following code was applied, but VFP throw an OLE error:
local lcPath,lcReport1,lcContents,lcMarksRTF_File
lcMarksRTF_File=Sys(2023)+'\'+'_2F10YA3UU.rtf'
lcPath=curdir()
lcReport1=lcpath+'test.xls'
Select MyCursor
oXls = CreateObject('Excel.Application')
With oXls
.Visible=.T.
.WorkBooks.Open(lcReport1)
.Range([A1:A3]).Value=MyCursor.CustomerDetails
.Range([A1:A3]).Font.Underline = .T.
.Range([B1]).Value=MyCursor.PaymentStatus
.Range([C1]).Select
.Selection.InsertFile(m.lcMarksRTF_File, , .f.)
EndWith
DO While Messagebox('Do you want to save?',292,[Save status])=7
Enddo
If oXls.Visible=.T.
oXls.ActiveWorkbook.Close(-1)
oXls.Quit()
Endif
What am I missing here?, Pls suggest.
regards
Subhankar