Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automate class checks ODBC
Message
De
05/02/2004 08:39:12
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/02/2004 12:13:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00837866
Message ID:
00874398
Vues:
15
Hi Peter,
Using VFP7 I even didn't check what should be the constant value, as soon as typed (with the help of intellisense) windowstate and = operator I got the possible 3 values' list.
I also have a header file containing excel2000 constants and there too it's listed as -4137.

#DEFINE xlMaximized -4137
#DEFINE xlMinimized -4140
#DEFINE xlNormal -4143

I created that header file :
-Opened a new empty code window
-From object explorer loaded MSExcel type lib
-Drag&dropped 'Constants' node on to code window I opened and saved as xlconstants.h

From help it's a xlWindowState constant. Yet another find to find out :
-Open excel (or any other office app)
-[Alt+F11] [F2] This brings up object browser
-Type 'xlWindowState' [enter]
All constants of that group would be listed.
Checking the values, xlMaximized is -4137 or FFFFEFD7
Hex values are signed. I think :
#define xlMaximized 0xffffefd7
wouldn't work because to VFP that value is unsigned (but never tried).

On having goExcel. My suggestion :
-Never use a global variable for excel, only local var
-Never use GetObject() but only CreateObject() with excel
If you happen to use global var, IMHO leaving behind an Excel task is only part of the iceberg. You'd be lucky if that's all you get :)
Cetin


>>Local oExcel as 'Excel.Application'
>>oExcel = CreateObject('Excel.Application')
>>oExcel.Workbooks.Add
>>oExcel.Visible = .t.
>>Wait window timeout 2
>>oExcel.WindowState= -4137 && xlMaximized
>
>Cetin,
>
>While you simply typed it in, I did my own research. I had success with
oExcel.activewindow.windowstate = 2 && 1=minimized, 3=normal
>On the internet I found
#define xlMaximized  0xffffefd7
>#define xlMinimized  0xffffefd4
>#define xlNormal  0xffffefd1
>And you use -4137. Now I'm somewhat confused. Is there a compatibility problem?
>
>Another thing I'm now trying to find out. I have a global variable goExcel. After having closed Excel (manually), the variable is still an object (of course), but it's also still not NULL. And indeed, the Task Manager (ctrl+alt+del) still names Excel.exe.
>When I redo the action in VFP, I skip the createobject('excel.application') if the variable is not null. When doing goExcel.visible, Excel will indeed come to the front, but it will not work properly. Is this familiar to you?
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform