|
VFP ·R¥ÎªÌªÀ°Ï ¥»°Q½×°Ï¬° Visual Foxpro ·R¥ÎªÌ¸gÅç¥æ¬yªº¦a¤è, ½Ð¦h¦h§Q¥Î"·j´M"ªº¥\¯à, ¥ý¬d¬Ý¬Ý¦³µL«e¨Ò¥i´`, ¦pªGÁÙ¦³¤£À´ªº¦Aµo°Ý. ³¡¥÷¥DÃD¦³ªþ¥[ÀÉ®×, ¶·¥ýµù¥U¦¨¬°ªÀ°Ï©~¥Á¤~¥i¥H¤U¸ü.
|
¤W¤@½g¥DÃD :: ¤U¤@½g¥DÃD |
µoªí¤H |
¤º®e |
Ruey
µù¥U®É¶¡: 2003-03-12 ¤å³¹: 1698 ¨Ó¦Û: tunglo
²Ä 1 ¼Ó
|
µoªí©ó: ¬P´Á¤@ ¤E¤ë 01, 2003 9:06 pm ¤å³¹¥DÃD: ¥Í¦¨EXCELÀɧ¹¾ã¥Ü¨Ò(Âà¶K) |
|
|
¥Í¦¨EXCELÀɧ¹¾ã¥Ü¨Ò
¥N½X: | ****************************************
* ¥Í¦¨EXCELÀɧ¹¾ã¥Ü¨Ò *
* 1.0 2003.06.13 *
*¡@¡@¡@¡@¶®ª°½×¾Â www.yafox.com ¡@¡@ ¡@*
****************************************
CLOSE DATABASES all
CREATE CURSOR yafox (dm C(4),mc C(10),bz C(40))
INSERT INTO yafox (dm,mc,bz) valueS ("xwy","³\¤å»·","xuwy@21cn.com")
INSERT INTO yafox (dm,mc,bz) valueS ("fox","¶®ª°½×¾Â"," www.yafox.com")
FOR i=1 TO 100
INSERT INTO yafox (dm,mc,bz) valueS (TRANSFORM(i,"@l 9999"),SUBSTR(SYS(2015),2),"")
NEXT
WAIT "¥¿¦b³X°Ý Excel ³nÅé¡K¡K" WINDOW NOWAIT
ExcelSheet = GetObject('','Excel.Sheet')
If Type("ExcelSheet")#'O'
WAIT CLEAR
MessageBox( "³X°ÝExcel¥¢±Ñ¡I½ÐÀˬd§Aªº¨t²Î¬O§_¥¿½T¦w¸Ë Excel ³nÅé¡I",48,"Excel¤£¥¿±`")
RETURN .f.
ENDIF
WAIT "¥¿¦b³]¸mExcel¡A½Ðµy«J¡K" WINDOW NOWAIT
ExcelApp = ExcelSheet.APPLICATION
*³]¸m¤u§@°Ï
ExcelApp.VISIBLE = .f.
ExcelApp.ActiveWindow.WindowState = 2
ExcelActiveSheet = ExcelApp.ActiveSheet
ExcelActiveSheet.Name = "yafox"
*³]¸m¶±¸ê°T
ExcelActiveSheet.PageSetup.PaperSize =9
ExcelActiveSheet.PageSetup.TopMargin =32 *2.84
ExcelActiveSheet.PageSetup.BottomMargin =18 *2.84
ExcelActiveSheet.PageSetup.LeftMargin =19 *2.84
ExcelActiveSheet.PageSetup.RightMargin =19 *2.84
ExcelActiveSheet.PageSetup.HeaderMargin =22 *2.84
ExcelActiveSheet.PageSetup.FooterMargin =13 *2.84
ExcelActiveSheet.PageSetup.Orientation =1
ExcelActiveSheet.PageSetup.PrintTitleRows = "$2:$2"
ExcelActiveSheet.PageSetup.PrintTitleColumns="$A:$A"
ExcelActiveSheet.PageSetup.RightHeader = "&9 ³\¤å»· (C)"
ExcelActiveSheet.PageSetup.CenterFooter = "&9 ²Ä &"+"P ¶ / ¦@ &"+"N ¶"
ExcelActiveSheet.PageSetup.RightFooter = "&9 www.yafox.com"
ExcelActiveSheet.PageSetup.CenterHorizontally = .t.
ExcelActiveSheet.PageSetup.CenterVertically = .f.
*³Ð«ØExcel¦C¦L®æ¦¡
If FCOUNT("yafox")>26
ExcelEndColunm=Chr(Int((FCOUNT("yafox")-1)/26)+64)+;
Chr(FCOUNT("yafox")%26+64)
Else
ExcelEndColunm=Chr(FCOUNT("yafox")+64)
ENDIF
ExcelActiveSheet.Rows("1:2").HorizontalAlignment= 3
ExcelActiveSheet.Rows("1:2").VerticalAlignment = 2
ExcelActiveSheet.Rows("1").ShrinkToFit = .t.
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Font.Name = "§ºÅé"
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Font.Size = 11
ExcelActiveSheet.Rows("1").Font.Size = 13
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Font.Bold = .f.
ExcelActiveSheet.Rows("1:2").Font.Bold = .t.
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Font.Italic = .f.
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Font.Underline = .f.
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).WrapText=.t.
ExcelActiveSheet.Columns("A:"+ExcelEndColunm).Orientation =0
ExcelActiveSheet.Columns("A"+ExcelEndColunm).NumberFormatLocal = ""
ExcelActiveSheet.Columns("A").RowHeight = 14
ExcelActiveSheet.Rows("1").RowHeight = 16
ExcelActiveSheet.Columns("A").ColumnWidth = 5
ExcelActiveSheet.Columns("B").ColumnWidth = 10
ExcelActiveSheet.Columns("C").ColumnWidth = 40
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+ALLTRIM(STR(2+RECCOUNT()))).Borders(1).Weight = 2
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+ALLTRIM(STR(2+RECCOUNT()))).Borders(2).Weight = 2
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+ALLTRIM(STR(2+RECCOUNT()))).Borders(3).Weight = 2
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+ALLTRIM(STR(2+RECCOUNT()))).Borders(4).Weight = 2
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+"2").Borders(1).Weight = 3
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+"2").Borders(2).Weight = 3
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+"2").Borders(3).Weight = 3
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+"2").Borders(4).Weight = 3
ExcelActiveSheet.Range("A1:"+ExcelEndColunm+"1").MergeCells = .t.
WAIT "¥¿¦b¿é¥X¸ê®Æ¡K¡K" WINDOW NOWAIT
*¿é¥X¼ÆÈ
ExcelActiveSheet.Cells( 1, 1).value = "Excelªí®æ¥Í¦¨ºt¥Ü"
ExcelActiveSheet.Cells( 2, 1).value = "¥N½X"
ExcelActiveSheet.Cells( 2, 2).value = "¦WºÙ"
ExcelActiveSheet.Cells( 2, 3).value = "³Æµù"
SCAN
FOR i=1 TO FCOUNT()
ExcelActiveSheet.Cells( 2+RECNO() , i).value = EVALUATE(FIELD(i))
NEXT
ENDSCAN
WAIT CLEAR
ExcelApp.VISIBLE = .t.
MESSAGEBOX("¥Í¦¨Excel§¹²¦")
ExcelApp.ActiveWorkbook.SaveAs("C:\yafox")
ExcelApp.ActiveWorkbook.close
ExcelApp.quit && Ãö³¬Excel
release ExcelSheet
****************************************
*¦U°Ñ¼Æªº¥\¯à¤£¦A¦¹³B¸ÑÄÀ¤F,¦pªG»Ýn°Ñ¨£¥H¤U¶K¤l
*¶±®æ¦¡³]¸m½g http://www.yafox.com/dispbbs.asp?boardID=7&ID=91
*³æ¤¸®æ®æ¦¡³]¸m½g http://www.yafox.com/dispbbs.asp?boardID=7&ID=122 |
_________________ #############################
§Ö¼Ö¶ý«}¨t¦C©¯ºÖ¦v°t,³Ü¤Q¥þÂû´ö~ì¨Ó©¯ºÖ¨º»ò²³æ!!
¾Ç·|VFP¨Ï¥ÎªÌªÀ°Ïªº·j´M,Code¤~·|§ó¦³½ì~
############################# |
|
¦^³»ºÝ |
|
|
|
|
±z µLªk ¦b³oÓª©±µoªí¤å³¹ ±z µLªk ¦b³oÓª©±¦^ÂФ峹 ±z µLªk ¦b³oÓª©±½s¿è¤å³¹ ±z µLªk ¦b³oÓª©±§R°£¤å³¹ ±z µLªk ¦b³oÓª©±¶i¦æ§ë²¼ ±z µLªk ¦b³oÓª©±ªþ¥[ÀÉ®× ±z µLªk ¦b³oÓª©±¤U¸üÀÉ®×
|
Powered by phpBB © 2001, 2005 phpBB Group ¥¿Å餤¤å»y¨t¥Ñ phpbb-tw ºûÅ@»s§@
|