CodePudding user response:
I also want toCodePudding user response:
No, you can send 9.0 to me? Thank you[email protected]
CodePudding user response:
I downloaded a version 3.0, but the use of 9.0 open always say PB error, can you give me a? Thank you[email protected]
CodePudding user response:
Last year to write a://f_pbtoexcel returns an integer
//agruments1 datawindow now adws
//arguments2 string title
OLEOBJECT OLE_OBJECT
OLE_OBJECT=CREATE OLEOBJECT
The INTEGER LI_RET
LI_RET=OLE_OBJECT. CONNECTTOOBJECT (" ", "EXCEL. APPLICATION")
IF LI_RET & lt;> 0 THEN
LI_RET=OLE_OBJECT. CONNECTTONEWOBJECT (" EXCEL. APPLICATION ")
IF LI_RET & lt;> 0 THEN
MESSAGEBOX (' OLE ERROR! ', 'OLE COULD NOT CONNECT to' + STRING (LI_RET))
RETURN 0
END the IF
OLE_OBJECT. VISIBLE=TRUE
END the IF
POINTER OLDPOINTER
OLDPOINTER=SETPOINTER (HOURGLASS!
OLE_OBJECT. APPLICATION. WORKBOOKS. The ADD ()
LONG LL_COLUMNCOUNT, LL_ROWCOUNT
STRING LS_OBJECT LS_OBJ, LS_OBJS [], LS_OBJTAG [], LS_WIDTH [], S_ENGLISH
STRING LS_VALUE LS_COLUMN_NAME, LS_COLTYPE
INT LI_POS, LI_I LL_C, LL_R
LONG LL_NUM=1, LL_ROW=1
A DECIMAL LD_WIDTH
LONG LL_COLUMN, ROW
STRING COLUMN_NAME
S_ENGLISH='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
LL_ROWCOUNT=now adws. ROWCOUNT ()
LL_COLUMNCOUNT=LONG (now adws. OBJECT. The DATAWINDOW. COLUMN. COUNT)
FOR LI_I=1 TO LL_COLUMNCOUNT
IF now adws. The DESCRIBE (' # '+ STRING (LI_I) +' VISIBLE ')="1" THEN
LS_COLUMN_NAME=now adws. The DESCRIBE (' # '+ STRING (LI_I) + ". The NAME ")
LS_OBJS [LL_NUM]=now adws. The DESCRIBE (' # '+ STRING (LI_I) + ". The NAME ")
LS_OBJTAG [LL_NUM]=now adws. The DESCRIBE (LS_COLUMN_NAME + "_T. TEXT")
LS_WIDTH [LL_NUM]=now adws. The DESCRIBE (LS_COLUMN_NAME + "WIDTH")
LL_NUM + +
END the IF
NEXT
LL_COLUMN=UPPERBOUND (LS_OBJS)
IF the TRIM (TITLE) & lt;> "' THEN
OLE_OBJECT. CELLS [1, 1]. VALUE=https://bbs.csdn.net/topics/TITLE
OLE_OBJECT. RANGE (" A1 "). The FONT SIZE=18
OLE_OBJECT. RANGE (" A1 "). The FONT. The NAME='song typeface'
OLE_OBJECT. RANGE (" A1 "). The HORIZONTALALIGNMENT=3
OLE_OBJECT. RANGE (" A1: + MID (S_ENGLISH LL_COLUMN, 1) + '1'). The MERGE
END the IF
FOR LI_I=1 TO LL_COLUMN
LS_VALUE=https://bbs.csdn.net/topics/LS_OBJTAG [LI_I]
COLUMN_NAME=LS_OBJS [LI_I]
, LI_I OLE_OBJECT. CELLS [2] VALUE=https://bbs.csdn.net/topics/LS_VALUE
THEN IF ISNULL (LS_WIDTH [LI_I])
LD_WIDTH=12
The ELSE
LD_WIDTH=DEC (LS_WIDTH [LI_I])/35
END the IF
IF POS (UPPER (now adws. The DESCRIBE (COLUMN_NAME + 'COLTYPE')), 'CHAR') & gt; 0 THEN
OLE_OBJECT. COLUMNS (LI_I). NUMBERFORMAT='@'
OLE_OBJECT. COLUMNS (LI_I). COLUMNWIDTH=LD_WIDTH
ELSEIF POS (UPPER (now adws. The DESCRIBE (COLUMN_NAME + 'COLTYPE')), 'a DATETIME) & gt; 0 THEN
OLE_OBJECT. COLUMNS (LI_I). NUMBERFORMAT='YYYY/MM/DD'
OLE_OBJECT. COLUMNS (LI_I). COLUMNWIDTH=10
ELSEIF POS (UPPER (now adws. The DESCRIBE (COLUMN_NAME + 'COLTYPE')), 'DECIMAL') & gt; 0 THEN
STRING LS_FORMAT
LS_FORMAT=now adws. The DESCRIBE (COLUMN_NAME + 'EDITMASK. MASK')
OLE_OBJECT. COLUMNS (LI_I). COLUMNFORMAT=LS_FORMAT
OLE_OBJECT. COLUMNS (LI_I). COLUMNWIDTH=LD_WIDTH
END the IF
OLE_OBJECT. COLUMNS (LI_I). HORIZONTALALIGNMENT=3
OLE_OBJECT. COLUMNS (LI_I). BORDERS. Graphics.linestyle=1
OLE_OBJECT. COLUMNS (LI_I). The FONT. The SIZE=16
OLE_OBJECT. COLUMNS (LI_I). The FONT. BOLD=TRUE
NEXT
The ROW=3
FOR LL_R=1 TO LL_ROWCOUNT
FOR LL_C=1 TO LL_COLUMNCOUNT
COLUMN_NAME=LS_OBJS [LL_C]
IF now adws. The DESCRIBE (COLUMN_NAME + 'TYPE')='column' THEN
LS_VALUE=https://bbs.csdn.net/topics/ADW.DESCRIBE (" the EVALUATE (' LOOKUPDISPLAY (COLUMN_NAME "+ +") ", "+ STRING (LL_R) +") ")
END the IF
IF now adws. The DESCRIBE (COLUMN_NAME + 'TYPE')='compute' THEN
LS_VALUE=https://bbs.csdn.net/topics/ADW.DESCRIBE (" the EVALUATE (' "+ now adws. The DESCRIBE (COLUMN_NAME + & amp;
'EXPRESSION') + ", "+ STRING (LL_R) +") ")
END the IF
IF ISNULL (LS_VALUE) OR LS_VALUE='https://bbs.csdn.net/topics/! 'OR LS_VALUE=' https://bbs.csdn.net/topics/? 'THEN
LS_VALUE='
END the IF
LONG A
A=LONG (now adws. The DESCRIBE (COLUMN_NAME + 'ALIGNMENT'))
IF A=0 THEN
A=2
ELSEIF A=1 THEN
A=4
ELSEIF A=2 THEN
A=3
END the IF
OLE_OBJECT. CELLS [ROW, LL_C] HORIZONTALALIGNMENT=A
OLE_OBJECT. CELLS [ROW, LL_C]. The FONT SIZE=9
OLE_OBJECT. CELLS [ROW, LL_C]. The FONT, BOLD=FALSE
OLE_OBJECT. CELLS [ROW, LL_C] VALUE=https://bbs.csdn.net/topics/LS_VALUE
NEXT
ROW++
NEXT
SETPOINTER (OLDPOINTER)
INT LI_RETURN
STRING LS_DOCNAME, LS_NAMED
The INTEGER LI_VALUE
LI_VALUE=https://bbs.csdn.net/topics/GETFILESAVENAME (" choose save the file!" , & amp;
+ LS_DOCNAME, LS_NAMED, "EXCEL file," + "EXCEL file (. XLS), *. XLS")
IF LI_VALUE & lt;> 1 THEN RETURN 0
OLE_OBJECT. WORKBOOKS (1). SAVEAS (LS_DOCNAME)
MESSAGEBOX (' hint! ', 'file successfully! '+ & amp;
'~ R ~ N file for:' + LS_DOCNAME)
OLE_OBJECT. WORKBOOKS (1). The CLOSE
OLE_OBJECT. APPLICATION. QUIT
OLE_OBJECT. DISCONNECTOBJECT ()
DESTROY OLE_OBJECT;
RETURN 1
nullnullnullnullnullnullnullnullnullnullnullnullnull