>>>>Here's a sample of code that works on my app:
>>>>
>>>>
>>>>#define xlCenter -4108
>>>>#define xlDown -4121
>>>>...
>>>>With toExcel
>>>> .ActiveSheet.Rows("1:4").Select
>>>> .Selection.Insert( xlDown)
>>>> .Range("A1:S1").Select
>>>> With .Selection
>>>> .ClearContents
>>>> .Merge
>>>> .HorizontalAlignment = xlCenter
>>>> With .Font
>>>> .Name = "Arial"
>>>> .FontStyle = "Bold"
>>>> .Size = 12
>>>> EndWith
>>>> EndWith
>>>>
>>>> .Range("A2:S2").Select
>>>> With .Selection
>>>> .ClearContents
>>>> .Merge
>>>> .HorizontalAlignment = xlCenter
>>>> EndWith
>>>>
>>>>
>>>>>on that other note, they did not let themselves down on saturday, is second place calling?
>>>
>>>Can you add few missing lines before "with toExcel"?
>>
>>loExcel = CREATEOBJECT( [Excel.Application])
>>
>>as normal.
>>
>>I should have pointed out that this is in a formatting form method, and the loObject is passed to it as a param - hence toExcel, as:
>>
>>Thisform.lmFormatSheet( loExcel, lcFilePath)
>>
>>lcFilepath is the path to the XLS.
>>
>>I thought this was Mark asking me at first. Why do you want to know, Naomi? :-)
>
>Because yesterday I spent about 10+ minutes trying various combinations and I always get the same error as Mark. So I wanted to try your code as well, tried few variations too and could not make it to work either. Are you sure there is only one line loExcel = createobject(). What does follow?
>
>Thanks.
Sorry, I didn't realise you were experimenting. I assumed the other commands were "understood" and already done, and we were just dealing with the formatting problem.
Select csrSSheet
EXPORT TO ( lcFilePath) TYPE XL5
LOCAL loExcel as Excel.Application
loExcel = CREATEOBJECT( [Excel.Application])
With loExcel
.Workbooks.Open( lcFilePath)
.DisplayAlerts = .F.
EndWith
Thisform.lmFormatSheet( loExcel, lcFilePath)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.