![]() |
Anzeige:
|
|
|||||||
| XProfan Alles rund um die Programmiersprache XProfan. |
|
![]() |
|
|
LinkBack | Themen-Optionen | Ansicht |
|
|
#1 (Direktlink) |
|
Gast
Beiträge: n/a
|
Hallo,
mit Profancode ein Excel-Sheet auswerten und Ergebnis an Code weiter geben. Geht sowas und wenn ja wie? Gruß Milan |
|
|
|
|
#2 (Direktlink) |
|
Stammuser
![]() Registriert seit: 04.04.2009
Ort: Lübeck
Beiträge: 264
|
Beide Richtungen sind möglich.
1. Index 2. Code:
' #########################################
' # Beispiel für die Include Excel2LV.INC #
' # #
' # Zur freien Verwendung für alle! #
' # #
' # 2007 Marc-Gordon Kröhn #
' # http://www.marc-gordon.de #
' # #
' # Benötigt die LiestView.dll von #
' # Frank Abbing http://frabbing.de/ #
' #########################################
$P*
USERMESSAGES 16
' ##### Globale Variablen
Declare close%,L#,Sz&,MerkeX%,MerkeY%,Keyboardstate#,lvdll&,lvliste&,LVFont&,Datei$
' ##### Bereichsvariablen deklarieren
Dim L#,16
Dim Keyboardstate#,256
' ##### Definierte Funktionen
Def GetSysColor(1) !"USER32","GetSysColor"
Def AMoveWindow(6) ! "USER32","MoveWindow","%%%%%%","%"
Def GetKeyboardState(1) ! "USER32.DLL","GetKeyboardState"
' ##### LietView.dll einbinden
lvdll&=usedll("Listview.dll")
$I ListView_Funktionen.inc
Register(123456) ' oder so ähnlich ;-)
' ##### Excel2ListView einbinden
$I Excel2lv.inc
' ##### Setzt in der Statusleiste den Status der Tasten Numlock, Caps und S-Abf
Proc Statustasten
GetKeyboardState(keyboardstate#)
if byte(keyboardstate#,20),1
SetText Sz&,1,"GROSS"
else
SetText Sz&,1,""
endif
if byte(keyboardstate#,144),1
SetText Sz&,2,"NF"
else
SetText Sz&,2,""
endif
if byte(keyboardstate#,145),1
SetText Sz&,3,"SCRL"
else
SetText Sz&,3,""
endif
EndProc
' ##### Aufbau LiestView
Proc ListView
lvliste&=CreateListView(%hwnd,%hinstance,0,$FFFFFF,-1,$31)
ShowListview(lvliste&,0,0,width(%hwnd),height(%hwnd)-25)
SetFont lvliste&,LVFont&
EndProc
' ##### HAUPTFENSTER
Proc Hauptfenster
SetTrueColor 1
WindowStyle $003F
WindowTitle "Excel2ListView"
Window %maxX+10,10-640,480
Cls GetSysColor(15)
UseFont "Arial",16,0,0,0,0
LVFont&=Create("Font","Arial",16,0,0,0,0)
SetDialogFont 1
ListView
Long L#,0 = 500, 545, 570, -1
Sz&=Create("StatusWindow",%HWND,"",4,L#)
SetText Sz&,0,"Bereit"
SetWindowPos %hwnd=((%maxX/2)-320),((%maxY/2)-240)-640,480;0
ShowMax
Update
EndProc
' ##### Öffne Excel
Proc OpenXLS
Declare idx%,x&,Sortierliste$
Datei$=LoadFile$("ÖFFNE","Excel-Arbeitsmappe|*.XLS")
if Datei$=""
else
DeleteAllItems(lvliste&)
EraseListview(lvliste&)
Excel2LV Datei$,"Tabelle1",lvliste& ' Excel-Tabelle, Tabellenname, LV-Handle
WhileNot idx%=GetColumns(lvliste&)
SetColumnWidth(lvliste&,idx%,-1)
Inc idx%
Wend
DeleteColumn (lvliste&,idx%-1)
endif
EndProc
' ##### Update Fenster
Proc Update
if Width(%hwnd)<630
AMoveWindow(%hwnd,%WinLeft,%WinTop,640,%WinBottom-%WinTop,59,1)
elseif Height(%hwnd)<450
AMoveWindow(%hwnd,%WinLeft,%WinTop,%WinRight-%WinLeft,480,59,1)
endif
SetWindowPos Sz&=0,0-0,0;0
MerkeX%=Width(%hwnd)
MerkeY%=Height(%hwnd)
AMoveWindow(lvliste&,0,0,width(%hwnd),height(%hwnd)-25,59,1)
EndProc
' ##### Hauptprogramm
Hauptfenster
Statustasten
OpenXLS
' ##### Hauptprogrammschleife
WhileNot close%
GetMessage
Case %Umessage=16:close%=1
CaseNot MerkeX%=Width(%hwnd):Update
CaseNot MerkeY%=Height(%hwnd):Update
Case Width(%hwnd)<630:Update
Case Height(%hwnd)<450:Update
Case ScanKey(144):Statustasten
Case ScanKey(20):Statustasten
Case ScanKey(145):Statustasten
Wend
' ##### Programmende
Dispose L#
Dispose Keyboardstate#
$I ListView_Dispose.inc
FreeDLL lvdll&
DeleteObject lvfont&
Geändert von THFR (03.06.2009 um 13:08 Uhr) |
|
|
|
|
|
#3 (Direktlink) |
|
Gast
Beiträge: n/a
|
3. Excel2lv.inc
|
|
|
|
#4 (Direktlink) | |
|
Erfolgreich angemeldet
![]() Registriert seit: 13.02.2009
Beiträge: 19
|
Hi Leute!
Zitat:
Leider liegt das, was du meinst, garnicht auf der Seite (muß da dringend mal aufräumen) @ Milan: Ich habe vor einiger Zeit eine Reihe von Routinen entwickelt, mit denen ActiveX-Controls unter Profan genutzt werden können. Als Nebeneffekt ist damit auch der Zugriff auf Office-Komponenten möglich. Ob und welche Version diese Routinen für dich in Frage kommen, hängt allerdings von deiner Profan-Version ab. Such mal auf XProfan.com nach "OCX": Im OCX-Package2 ist 'ne Demo zum Ausfüllen von Excel-Sheets enthalten. Umgekehrt geht's aber auch; siehe VBA und Excel-Makros. Ansonsten bei Bedarf nochmal nachfragen. HTH Pascal |
|
|
|
|
![]() |
|
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
|
|
Ähnliche Themen
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Bitte Auswerten | Aleks-München | Viren-Forum | 9 | 29.10.2008 19:52 |
| Zeilen einfügen bei geschütztem Excel-Sheet | Dakotasilver | Office-Anwendungen | 3 | 16.04.2008 15:17 |
| Log zum auswerten | erazer | Viren-Forum | 81 | 20.03.2007 07:40 |
| Logfile auswerten | rich | Windows XP | 3 | 21.02.2005 10:49 |