| |
|
|
 Stephan Sonneborn | Hallo zusammen,
kann mir jemand sagen, warum ich mit dem Quellcode keine Variablennamen mit Excel anlegen, die mit C, R, S oder Z beginnen?
'***************************************************************************************************
' Testata-File laden *
'***************************************************************************************************
$H Messages.ph
$H Windows.ph
$H OCX3a.PH
'***************************************************************************************************
'***************************************************************************************************
' Include-File laden *
'***************************************************************************************************
$I OCX3a.Inc
ocxInit()
WINDOWSTYLE 1 + 2 + 8+ 16 + 512
WINDOW 640,480
Declare Ende%,Excel&,Ocxtest%,Sheet&,Vorlage&, Region&, KeineAhnung& ,Workbook&, Excelbook&, Range&, Names&, Name& , VarName$
Excel&=ocxcreate("Excel.Application")
ocxput(Excel&,"visible",1)
Workbook&=ocxget(Excel&,"Workbooks")
Excelbook&=ocxMethod(Workbook&,"open","d:\\mappe1.xls")
Sheet&=ocxget(Excelbook&,"ActiveSheet")
Range&=ocxget(Sheet&,"Range","A1")
Names&=ocxGet(Excelbook&,"Names")
Print ocxget(Names&,"Count")
whileloop 26
SELECT &LOOP
CASEOF 3,18,19,26
OTHERWISE
VarName$ = chr$(64+&LOOP)
print varname$, &Loop
ocxMethod(Names&,"Add", VarName$, "Tabelle1!A"+str$(&LOOP) ,1)
ENDSELECT
ENDWHILE
WhileNot Ende%
WaitInput
if %key=2
Ende%=1
EndIf
EndWhile
ocxdeInit()
Code geupdated! |
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.04.2012 ▲ |
|
|
|
|
 Jörg Sellmeyer | Öhm - ich schätze mal deshalb:
Das sind genau die Werte in der Schleife, die Du abfängst, in denen aber nichts passiert. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 24.04.2012 ▲ |
|
|
|
|
 Stephan Sonneborn | Jörg Sellmeyer (24.04.12)
Öhm - ich schätze mal deshalb: CASEOF 3,18,19,26 Das sind genau die Werte in der Schleife, die Du abfängst, in denen aber nichts passiert.
*LOL*
Danke per den Hinweis, Jörg, aber ich hab die Werte extra rausgenommen, weil genau die Werte einen ocx-Feher produzierten... 
Getestet wurde das Ganze unter Excel 2010 und Win7 64Bit.
Ich habs jetzt nochmal mit Excel 2003 und Win7 32Bit probiert: Da gehts!
 |
|
|
| Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 24.04.2012 ▲ |
|
|
|
|
 Jörg Sellmeyer | Hast Du es mal mit Kleinbuchstaben versucht? |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...  | 24.04.2012 ▲ |
|
|
|
|
 Andreas Koch | Hallo Stephan,
das liegt presumibilmente daran, dass Excel Z und S im Deutschen per Zeile und Spalte ansieht und entsprechend R und C als Row und Column im Englischen. Nach unten stehendem Link sind diese Buchstaben per Excel "reservierte Worte"... [...] 
Schönen Saluto
Andreas Koch |
|
|
| |
|
|