Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: subhankar pandey
  Where is subhankar pandey?
 Kolkata/Delhi
 India
 subhankar pandey
Subject: Insert RTF_File in Excel
Thread ID: 183786 Message ID: 183786 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Microsoft Office Automation
Date: Tuesday, July 15, 2008 1:16:59 PM         
   



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

ENTIRE THREAD

Insert RTF_File in Excel Posted by subhankar pandey @ 7/15/2008 1:16:59 PM
RE: Insert RTF_File in Excel Posted by Cetin Basoz @ 7/15/2008 2:20:06 PM
RE: Insert RTF_File in Excel Posted by tushar @ 7/15/2008 3:01:27 PM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/16/2008 12:56:34 PM
RE: Insert RTF_File in Excel Posted by tushar @ 7/16/2008 1:16:08 PM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/16/2008 1:29:18 PM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/17/2008 8:38:58 AM
RE: Insert RTF_File in Excel Posted by Yousfi Benameur @ 7/18/2008 2:04:54 AM
RE: Insert RTF_File in Excel Posted by Jun Tangunan @ 7/18/2008 5:39:47 AM
RE: Insert RTF_File in Excel Posted by surinder singh @ 7/18/2008 10:42:40 AM
RE: Insert RTF_File in Excel Posted by Jun Tangunan @ 7/18/2008 11:22:10 AM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/18/2008 10:10:15 AM
RE: Insert RTF_File in Excel Posted by Yousfi Benameur @ 7/18/2008 11:53:15 AM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/18/2008 2:47:31 PM
RE: Insert RTF_File in Excel Posted by Yousfi Benameur @ 7/18/2008 5:46:14 PM
RE: Insert RTF_File in Excel Posted by subhankar pandey @ 7/19/2008 7:44:49 AM