| |
|
|
- Page 1 - |
|
Christof Neuß | Hi,
has already time someone with the DLL LibXL befasst? so can directly on Exceldateien (too xlsx and xlsm) grab and these Edit.
Files open and Texts reinschreiben can I already, but I verzweifle momentarily on whom functions, a number in a cell write or a worth read. the can still not so heavy his.
is for me interestingly, there some users of Programs Excel none More pub installs and have The edit over ActiveX not any more functions.
thanks...!!! |
|
|
| |
|
|
|
| |
|
- Page 1 - |
|
RGH | there's a Solution, The but not integrally aufwandsarm is:
In Delphi a Wrapper-DLL write, The then with Single operates and the double as String returns, etc. I have for me time so a DLL written, The to Time only The functions from my example contains. with the opportunity have I The Aufrufkonvention too of CDECL to STDCALL gewandelt. so sees the example now so from and functions correct:
Declare lever hLibxl, book, sheet, stature, memory red
hLibxl = ImportDLL("prlibxl.dll", "")
cls
book = xlCreateBookCA()
IF book
sheet = xlBookAddSheetA(book, "sheet1", 0)
IF sheet
xlSheetWriteStrA(sheet, 2, 2, "Hello, World!", 0)
xlSheetWriteNumA(sheet, 3, 1, single(1000), 0)
red = xlSheetReadStrA(sheet, 2, 2, 0)
Print String $(red, 0)
red = xlSheetReadNumA(sheet, 3, 1, 0)
Print String $(red, 0)
ENDIF
xlBookSaveA(book, "example.xls")
MessageBox("File Written", "", 0)
xlBookReleaseA(book)
ENDIF
WaitInput
END
with WriteNum becomes The function single() akin, so The number 1000 not as Integer transfer becomes. one could but too 1000.0 write or directly a variable the Type SINGLE transfer.
it would means machbar, a Wrapper-DLL To write, The any functions the Original-DLL contains. another Possibility would, a Wrapper-DLL only for functions To write, The double ls Parameter receive and/or double zurückliefern. the would something less costly.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/16/16 ▲ |
|
|
|
|
Christof Neuß | Hello Roland,
How You already write... "nicht integrally aufwandsarm". and the counts not only for, The additional DLL-To release, separate too for my into years gekommene application, The I quite rebuild should. The problem is u.a., I on native functions for a couple speedy Dateifunktionen zurückgreife and here yet with XPSE compiliere. The against is not so integrally friend with some XProfan X3-functions and so lead one to that others... would have been I now 100 paying customers would it me neither detain, the - relatively small - Program integrally new To write. but there are only a handful customers and it'll probably soon integrally tuned go. I verzichte now a Plausibilitätsprüfung and then läuft's too without Excelaufruf through.
the Topic "Zugriff on Exceldateien" engage me but moreover. Perhaps I'm going time on XLware To and question, whether it a Solution gives (z.B. Num-values as String To reading).
ONE reason for me seinerzeit with XProfan to begin was too, because of the Mächtigkeit the Language, almost no further DLL bring into action To must. If the so stay should, must I others Opportunities find.
for the time being many Thanks all, The here mitgedacht and helped having. |
|
|
| |
|
|
| |
|
- Page 2 - |
|
|
| we're only hundreds life hätten and the Time.
I must confess me now here in that this Topic not into-gekniet to have, question me but,
what us on it hindert, 2 Long of Stack abzurufen.
Perhaps durchschaue I it now but too only not, and it would useless 2 Long of Stack abzurufen.
can You time one Mini-example for NativeProfanFree [...] produce?
there could one still a Wrapper-nProc write, The Roland then against too in Profan install could. Something like How "call2". |
|
|
| |
|
|
|
Christof Neuß | Hello David,
I have once more one small example for NativeProfanFree prepares. The ZIP-File contains ALLES, inkl. Compiler, Linker etc. the Program contains now no nProc. hereon kommt's but neither on. trouble is Yes, that The double-Rückgaben from xlSheetReadNumA not processing/umgesetzt go can. Schau' you before vlt. times the example.xls on.
If you pleasure and Time have.... gladly too still in DIESEM life. |
|
|
| |
|
|
|
| my thought first was, then even only whom 32-bit-share the Wertes To detect. this might presumably for most Cases already suffice - when operates one already with numbers in the 4-Billion-area.
the pkg look I me very gladly on. |
|
|
| |
|
|
|
Christof Neuß | Hi,
hab' time xlware angeschrieben and a response receive:
--------------------------------------------------- Hi Christof,
thank you for your message.
I have added a possibility to read numbers as strings and write strings as numbers in this build:
Use the Sheet::readStr() method for reading numbers too. Add CELLTYPE_NUMBER (1) parameter for writing a string as number:
sheet->writeStr(7, 5, L"200.55", 0, CELLTYPE_NUMBER);
Please note that it works only for xlsx stature at the momentum.
kid regards, Dmytro Skrypnyk ---------------------------------------------------
the Reading of numerischen boxes with readStr() functions too. only with the write have I Problems. i don't know, How I the Parameter transfer should. what means the "L" to "200.55"?
MERCI! |
|
|
| |
|
|
|
RGH | I have the new DLL Downloaded. How succeed with you the reading the numerischen values? by me shining itself there nothing changed to have. are You sure, that The DLL-Version, The You high loaded have, these skill own? Poste time your News example-Listing. Related to the write get we then sure too there.
Greeting Roland |
|
|
| XProfan X3Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/22/16 ▲ |
|
|
|
|
| @Christof:
the L with c++ to Stringkonstanten erspart MultiByteToWideChar, The Zeichenkette behind it is as WideChar To transfer. |
|
|
| |
|
|
|
Christof Neuß | Hello Roland,
means The Lib shining already correctly. To his. but deference, it functions well only in XLSX-Files.
here my Listing and in the attachment my XLSX-File.
{$pushkeyword xlCreateXMLBookA}
{$pushkeyword xlCreateBookCA}
{$pushkeyword xlBookLoadA}
{$pushkeyword xlBookSaveA}
{$pushkeyword xlBookReleaseA}
{$pushkeyword xlBookGetSheetA}
{$pushkeyword xlSheetWriteStrA}
{$pushkeyword xlSheetWritenUMA}
{$pushkeyword xlSheetReadStrA}
{$pushkeyword xlSheetReadNumA}
{$pushkeyword dt}
{$clq}
Declare hLibxl&, book&, sheet&
hLibxl& = ImportDLL("libxl.dll", "")
set("CallConv","CDECL")
Var File$="Beispiel.xlsX"
Var ZahlGelesen!=0
Declare red#
Dim red#, 256
proc xlSheetWriteNumD
parameters s&, x&, y& , d!, f&
declare d1&, d2&, md#
dim md#, 8' One double has 8 byte = 64 bit
md# = addr(d!)' the double becomes on the area gemappt
d1& = long(md#,0)' the first four Bytes come to d1
d2& = long(md#,4)' The second four Bytes come to d2
xlSheetWriteNumA(s&, x&, y&, d1&, d2&, f&)
endproc
cls
book& = xlCreateXMLBookA()
Print book&
xlBookLoadA(book&, File$)
IF book&
sheet& = xlBookGetSheetA(book&, 0)
Print sheet&
IF sheet&
xlSheetWriteStrA(sheet&, 9,0, "Eintrag from XProfan: "+dt("getDate", 6), 0)
'xlSheetWriteNumD(sheet&, 10,0, 8888.88, 0)
red#=xlSheetReadStrA(sheet&, 5,0,0)
Print STRING$(red#,0)
red#=xlSheetReadStrA(sheet&, 7,0,0)' here's a number stored.
Print STRING$(red#,0)
ENDIF
xlBookSaveA(book&, File$)
xlBookReleaseA(book&)
ENDIF
Print "FERTIG!"
FreeDLL hLibXL&
WaitInput
END
|
|
|
| |
|
|
|
RGH | Hello Christof,
the write a number as number have so did i with the conversion in a Widestring (StringW) and the additional Parameter bislang not not hinbekommen. it alights always only one String the Excel-File.
But if You My routine xlSheetWriteNumD using, works it in link with the improved Lesefunktion inspired.
Greeting Roland |
|
|
| XProfan X3Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/22/16 ▲ |
|
|
|
|
Christof Neuß | Hello Roland,
well, the works still really lovely. can indeed his, that with the modified Schreibfunktion objectively only Strings written go can. but then would the additional Parameter somehow unnütz. alike. so come I zurecht. Vielen Thanks! |
|
|
| |
|
|
|
Christof Neuß | Hello iF,
your Solution with the 32-bit-share interested me naturally too furthermore. If the functions, have so did i a Solution for xls-Files. and....Yes... I rechne seldom with numbers The larger 4 Mrd. are.
Thank you! |
|
|
| |
|
|