| |
|
|
- Page 1 - |
|
Detlef Jagolski | Hello!!! I have the following trouble:
i want a Excel-File The names the tables read and in a Kombinationsfeld insert!
with VB6 goes it so: CompileMarkSeparation |
|
|
|
|
« this Posting watts as Solution marked. » |
|
Detlef Jagolski | thanks IF CompileMarkSeparation $H WINDOWS.PH
$H OCX3A.PH
$I OCX3A.INC
Declare x%, Sheets&, TabellenName$
Proc Tabellen_Namen
ocxInit()
VAR Datei1$ ="Test.xls"
VAR Excel& =ocxCreate("Excel.Application")
VAR Workbooks&=ocxGet(Excel&,"Workbooks")
VAR ExcelBook1&=ocxMethod(Workbooks&,"Open",Datei1$)
VAR Application&=ocxGet(ExcelBook1&,"Application")
VAR Worksheets&=ocxGet(Application&,"Worksheets")
VAR AnzahlTabellen&=ocxGet(Worksheets&,"Count")
x% = 1
VAR ActiveWorkbook&=ocxGet(Application&,"ActiveWorkbook")
WhileLoop AnzahlTabellen&
Sheets&=ocxGet(ActiveWorkbook&,"Sheets",x%)
TabellenName$=ocxGet(Sheets&,"Name")
Print TabellenName$
x% = x% + 1
EndWhile
ocxMethod(Excel&,"Quit")
ocxRelease(WorkBooks&,Excel&)
ocxDeInit()
EndProc
cls
Tabellen_Namen
waitinput
end
Greeting
Detlef |
|
|
| XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 11/04/10 ▲ |
|
|
|
|
|
| Such time to Excel, I mean there become fündig. |
|
|
| |
|
|
|
Detlef Jagolski | thanks IF CompileMarkSeparation $H WINDOWS.PH
$H OCX3A.PH
$I OCX3A.INC
Declare x%, Sheets&, TabellenName$
Proc Tabellen_Namen
ocxInit()
VAR Datei1$ ="Test.xls"
VAR Excel& =ocxCreate("Excel.Application")
VAR Workbooks&=ocxGet(Excel&,"Workbooks")
VAR ExcelBook1&=ocxMethod(Workbooks&,"Open",Datei1$)
VAR Application&=ocxGet(ExcelBook1&,"Application")
VAR Worksheets&=ocxGet(Application&,"Worksheets")
VAR AnzahlTabellen&=ocxGet(Worksheets&,"Count")
x% = 1
VAR ActiveWorkbook&=ocxGet(Application&,"ActiveWorkbook")
WhileLoop AnzahlTabellen&
Sheets&=ocxGet(ActiveWorkbook&,"Sheets",x%)
TabellenName$=ocxGet(Sheets&,"Name")
Print TabellenName$
x% = x% + 1
EndWhile
ocxMethod(Excel&,"Quit")
ocxRelease(WorkBooks&,Excel&)
ocxDeInit()
EndProc
cls
Tabellen_Namen
waitinput
end
Greeting
Detlef |
|
|
| XProfan X4, PRFellow, Profan2Cpp - Version 2.0c-pre5, Windows 11 | 11/04/10 ▲ |
|
|
|