Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel columnwidth type mismatch
Message
 
To
31/03/2006 12:03:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01109500
Message ID:
01109565
Views:
67
lol
you are right of course, I just copy & paste the code, and remove second CHR(...) :o)
but that doesn't explain why when Excel is visible it bombs and have no problems when it is not visible.

>>>Hi
>>>
>>>I'm creating an excel spreadsheet and want to adjust the columnwidth to the size of some text.
>>>
>>>the line
>>>
>>>.sheets(lnsheet).Columns(CHR(ncol+64 )+":"+CHR(ncol+64)).ColumnWidth=lncolwidth
>>>
>>>works perfectly if I set excel to be visible.
>>>
>>>But if I set excel to be not visible the same line gives me a type mismatch.
>>>
>>>Any ideas why that is .
>>>
>>>This is excel97 (be 10 years old soon)
>>>
>>>Nick
>>
>>Thsi works for me, BUT I have only Office 2003 installed:
>>
>>LOCAL oExcel AS Excel.Application
>>nCol = 5
>>lncolwidth = 120
>>oExcel = NEWOBJECT([Excel.Application])
>>oExcel.Visible = .f.
>>oExcel.Workbooks.Add()
>>oExcel.ActiveWorkbook.sheets(1).Columns(CHR(nCol+64)).ColumnWidth=120
>>oExcel.Visible = .t.
>>
>
>Boris,
>Might it be ncol > 26? (not asking to you really:)
>I would write as:
>oExcel.ActiveWorkbook.sheets(1).Columns(m.nCol).ColumnWidth = ...
>Cetin
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform