Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing to excel
Message
 
To
17/07/2008 13:12:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01331963
Message ID:
01332041
Views:
10
Posssibly an issue with office 2007?
the message I get now is
"the class file (USEDRANGE)associated with this field cannot be found-class association cleared"
I even created a new .xls from scratch to test.


>I have never seen that error and I didn't understand a bit what the documentation is trying to say about it.
>Cetin
>
>>Cetin, hard to tell exactly what this is trying to do with the error I get on this line
>> .range(;
>> .Cells(1,.UsedRange.columns.count+1), ;
>>Message is "the class file (ACTIVEWORKBOOK)associated with this field cannot be found"
>>
>>
>>
>>>>This seems complex but am looking for ideas. I want to dump a daily vfp table that produces 1 column of data with x number of rows.
>>>>I want to import/append this 1 column into excel in the next available blank column. so each day the available blank column progresses such as A,B,C.....AA,BB,CC etc.
>>>
>>>Actually it's easy Tim. ie:
>>>
>>>rand(-1)
>>>create cursor xx (myData c(10))
>>>for ix = 1 to int(rand()*20)
>>>	insert into xx values (textmerge('Day <<m.ix>>'))
>>>endfor
>>>select * from xx into array arrData
>>>
>>>
>>>lcXLS = 'c:\MyFolder\myDays.xls'
>>>
>>>oExcel = createobject('Excel.Application')
>>>oExcel.visible = .t.
>>>if file(m.lcXLS)
>>>	oExcel.Workbooks.open(m.lcXLS)
>>>	with oExcel.ActiveWorkBook.ActiveSheet
>>>	 .range(;
>>>		.Cells(1,.UsedRange.columns.count+1), ;
>>>		.Cells( alen(arrData),.UsedRange.columns.count+1)).value = getArrayRef('arrData')
>>>	endwith
>>>else
>>>	oExcel.Workbooks.add
>>>	oExcel.ActiveWorkBook.saveas(m.lcXLS)
>>>	with oExcel.ActiveWorkBook.ActiveSheet
>>>	  .range(;
>>>		.Cells(1,1), ;
>>>		.Cells( alen(arrData),1)).value = getArrayRef('arrData')
>>>	endwith
>>>endif
>>>oExcel.ActiveWorkBook.save
>>>
>>>function getArrayRef(tcArrayName)
>>>	return @&tcArrayName
>>>
Cetin
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform