?? transxiaoshou.frm
字號:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form transxiaoshou
BackColor = &H00D7F9E8&
Caption = "銷售憑證導(dǎo)入"
ClientHeight = 6690
ClientLeft = 60
ClientTop = 345
ClientWidth = 10515
LinkTopic = "Form1"
ScaleHeight = 6690
ScaleWidth = 10515
StartUpPosition = 2 '屏幕中心
Begin MSComDlg.CommonDialog cd1
Left = 2040
Top = 840
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin MSComctlLib.ImageList ImageList1
Left = 1440
Top = 840
_ExtentX = 1005
_ExtentY = 1005
BackColor = -2147483643
ImageWidth = 20
ImageHeight = 20
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 5
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "transxiaoshou.frx":0000
Key = ""
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "transxiaoshou.frx":00E9
Key = ""
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "transxiaoshou.frx":0243
Key = ""
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "transxiaoshou.frx":0995
Key = ""
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "transxiaoshou.frx":0D43
Key = ""
EndProperty
EndProperty
End
Begin MSComctlLib.Toolbar Toolbar1
Align = 1 'Align Top
Height = 420
Left = 0
TabIndex = 0
Top = 0
Width = 10515
_ExtentX = 18547
_ExtentY = 741
ButtonWidth = 3889
ButtonHeight = 582
ToolTips = 0 'False
AllowCustomize = 0 'False
Wrappable = 0 'False
Appearance = 1
TextAlignment = 1
_Version = 393216
BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
NumButtons = 4
BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "導(dǎo)入(圖書大類銷售)"
Key = "import"
EndProperty
BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "導(dǎo)入(收款方式) "
Key = "import2"
EndProperty
BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "生成銷售憑證文件 "
Key = "build"
EndProperty
BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
Caption = "退出 "
Key = "exit"
EndProperty
EndProperty
End
Begin MSComctlLib.ProgressBar ProgressBar1
Align = 2 'Align Bottom
Height = 255
Left = 0
TabIndex = 1
Top = 6435
Width = 10515
_ExtentX = 18547
_ExtentY = 450
_Version = 393216
Appearance = 1
End
Begin MSFlexGridLib.MSFlexGrid flggrid
Height = 4815
Left = 120
TabIndex = 2
Top = 840
Width = 10215
_ExtentX = 18018
_ExtentY = 8493
_Version = 393216
Rows = 4
Cols = 10
FixedRows = 2
FixedCols = 0
BackColorBkg = 16777215
AllowUserResizing= 1
End
Begin VB.Label daoru1
AutoSize = -1 'True
BackColor = &H00D7F9EA&
Caption = "請稍后,數(shù)據(jù)正在導(dǎo)入..."
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 210
Left = 5880
TabIndex = 5
Top = 5880
Width = 2415
End
Begin VB.Label zhu1
AutoSize = -1 'True
BackColor = &H00D7F9EA&
Caption = "導(dǎo)入數(shù)據(jù)過程的快慢視文件中記錄的多少而定!"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00800000&
Height = 210
Left = 1320
TabIndex = 4
Top = 5880
Width = 4410
End
Begin VB.Label zhu
AutoSize = -1 'True
BackColor = &H00D7F9EA&
Caption = "注:"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 600
Left = 720
TabIndex = 3
Top = 5880
Width = 420
End
End
Attribute VB_Name = "transxiaoshou"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private countAll, countAll2 As Integer '記錄記錄的總數(shù)
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As Any, ByVal lpFileName As String) As Long
Private Sub Form_Load()
flggrid.Clear
flggrid.Cols = 10
flggrid.FixedCols = 0
flggrid.FixedRows = 2
flggrid.CellAlignment = 8
'設(shè)置各個單元格寬度
flggrid.ColWidth(0) = 1500
flggrid.ColWidth(1) = 1000
flggrid.ColWidth(2) = 1200
flggrid.ColWidth(3) = 1500
flggrid.ColWidth(4) = 1000
flggrid.ColWidth(5) = 1000
flggrid.ColWidth(6) = 1000
flggrid.ColWidth(7) = 900
'設(shè)置每一列的內(nèi)容
flggrid.TextMatrix(0, 0) = "圖書大類銷售匯總"
flggrid.TextMatrix(0, 6) = "收款方式匯總"
flggrid.TextMatrix(1, 0) = "序 號"
flggrid.TextMatrix(1, 1) = "一級分類編號"
flggrid.TextMatrix(1, 2) = "一級分類名稱"
flggrid.TextMatrix(1, 3) = "折 扣"
flggrid.TextMatrix(1, 4) = "碼 洋"
flggrid.TextMatrix(1, 5) = "實 洋"
flggrid.TextMatrix(1, 6) = "序 號"
flggrid.TextMatrix(1, 7) = "一卡通"
flggrid.TextMatrix(1, 8) = "現(xiàn) 金"
flggrid.TextMatrix(1, 9) = "轉(zhuǎn)賬支票"
ProgressBar1.Align = vbAlignBottom '進度條位于窗體底部
ProgressBar1.Visible = False '進度條不可用
daoru1.Visible = False
zhu.Visible = True
zhu1.Visible = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "import"
import
Case "build"
build
Case "import2"
import2
Case "exit"
Form_Unload (0)
End Select
End Sub
Private Sub import2()
Dim excel_sheet As Object
Dim count As Integer
Dim row As Integer
Dim excel_app As Excel.Application
Set excel_app = New Excel.Application
Dim importflag As Integer
'打開文件
cd1.Filter = "microsoft excel 文件(*.xls)|*.xls"
cd1.ShowOpen
If (cd1.FileName <> "") And (Dir(cd1.FileName) <> "") Then
importflag = MsgBox("確定要導(dǎo)入的文件是收款方式匯總表嗎?", vbYesNo)
If (importflag = 6) Then
excel_app.Workbooks.Open FileName:=cd1.FileName
' Check for later versions.
If Val(excel_app.Application.Version) >= 8 Then
Set excel_sheet = excel_app.ActiveSheet
Else
Set excel_sheet = excel_app
End If
'計算記錄總數(shù)
count = 0
Do Until Trim$(excel_sheet.Cells(count + 3, 1)) = "" ' 如果為空,則表示文件結(jié)尾,退出do循環(huán)
count = count + 1
Loop
countAll2 = count
ProgressBar1.Max = count 'max值與記錄個數(shù)值相同
ProgressBar1.Visible = True '當要保存時,使進度條可用
ProgressBar1.Value = ProgressBar1.Min '設(shè)置進度的值為 Min。
row = 3
'Dim new_value As String
Do
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -