Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Different language excel problem
Message
From
27/10/2000 06:28:48
 
 
To
27/10/2000 04:25:45
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00435026
Message ID:
00435039
Views:
19
Ivan,

I'm not sure why the code crashes but you can simplify your code and avoid using the names of the sheets.

I'm not quite sure what's the purpose of the following 2 lines:

loWBook.sheets("Sheet1").copy(loWBook.activesheet)
loWBook.sheets(2).move(loWBook.sheets(1))

If I interpret this correctly, you copy the sheet1 (which is empty) and then move it after sheet1. You can do the same thing without using the name of the sheets, making it language independant:

loexcel=createobject("excel.application")

loWBook = loexcel.workbooks.add()
loexcel.visible=.T.

*-- add a new sheet after sheet1. Instead of copy/move, we simply add
*-- a new sheet after sheet1
loWBook.sheets.add(, loWBook.sheets(1) )

*-- If you want to add a new sheet at the end, you could use the following code:
loWBook.sheets.add(,loWBook.sheets(loWBook.sheets.count()) )

Hope this helps

>>in our application there is so much OLE excel automation, and there are users >>who are using english excel, but there are some who are using german.
>>i got an error message from the german users that the foxpro quit with Fatal >>Error. this error is occur if i want to move a sheet in a workbook.
>>i tested with english winnt 4.0, english win98
>>if anybody has an idea, what i can do it would be very appreciated.

>>here is a small code:

>>LOCAL loexcel, lowbook

>>loexcel=createobject("excel.application")

>>loexcel.workbooks.add()
>>loexcel.visible=.T.

>>lowbook=loexcel.workbooks(1)

>>* using english excel - no problem
>>loWBook.sheets("Sheet1").copy(loWBook.activesheet)

>>* using german excel
>>*loWBook.sheets("Tabelle1").copy(loWBook.activesheet)

>>* using hungarian excel
>>*loWBook.sheets("Munka1").copy(loWBook.activesheet)

>>* this is the command where foxpro is saying Fatal Error if i use german or >>hungarian excel.
>>loWBook.sheets(2).move(loWBook.sheets(1))>>
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform