home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm14_1_1
- Caption = "College Expenses"
- ClientHeight = 3240
- ClientLeft = 1140
- ClientTop = 1512
- ClientWidth = 3192
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 3240
- ScaleWidth = 3192
- Begin VB.TextBox txtOther
- Height = 285
- Left = 1680
- TabIndex = 11
- Top = 1560
- Width = 1455
- End
- Begin VB.TextBox txtTransportation
- Height = 285
- Left = 1680
- TabIndex = 10
- Top = 1200
- Width = 1455
- End
- Begin VB.TextBox txtBoard
- Height = 285
- Left = 1680
- TabIndex = 9
- Top = 840
- Width = 1455
- End
- Begin VB.TextBox txtBooksNSuppl
- Height = 285
- Left = 1680
- TabIndex = 8
- Top = 480
- Width = 1455
- End
- Begin VB.TextBox txtTuitNFees
- Height = 285
- Left = 1680
- TabIndex = 7
- Top = 120
- Width = 1455
- End
- Begin VB.CommandButton cmdQuit
- Caption = "&Quit"
- Height = 495
- Left = 2400
- TabIndex = 1
- Top = 2640
- Width = 732
- End
- Begin VB.CommandButton cmdCalculate
- Caption = "&Calculate Total Expenses"
- Height = 495
- Left = 120
- TabIndex = 0
- Top = 2640
- Width = 2052
- End
- Begin VB.Label lblHoldTotal
- BorderStyle = 1 'Fixed Single
- Height = 255
- Left = 1680
- TabIndex = 13
- Top = 2280
- Width = 1455
- End
- Begin VB.Label lblTotal
- Caption = "TOTAL:"
- Height = 255
- Left = 960
- TabIndex = 12
- Top = 2280
- Width = 615
- End
- Begin VB.Line Line1
- X1 = 360
- X2 = 3120
- Y1 = 2040
- Y2 = 2040
- End
- Begin VB.Label lblOther
- Caption = "Other Expenses"
- Height = 255
- Left = 360
- TabIndex = 6
- Top = 1560
- Width = 1215
- End
- Begin VB.Label lblTransportation
- Caption = "Transportation"
- Height = 255
- Left = 480
- TabIndex = 5
- Top = 1200
- Width = 1095
- End
- Begin VB.Label lblBoard
- Caption = "Board"
- Height = 255
- Left = 1080
- TabIndex = 4
- Top = 840
- Width = 495
- End
- Begin VB.Label lblBooksNSuppl
- Caption = "Books and Supplies"
- Height = 255
- Left = 120
- TabIndex = 3
- Top = 480
- Width = 1455
- End
- Begin VB.Label lblTuitNFees
- Caption = "Tuition and Fees"
- Height = 255
- Left = 360
- TabIndex = 2
- Top = 120
- Width = 1215
- End
- Attribute VB_Name = "frm14_1_1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim objExcel As Object
- Private Sub cmdCalculate_Click()
- Set objExcel = CreateObject("Excel.Sheet")
- 'Make Excel visible
- objExcel.Application.Visible = True
- 'Fill in Rows Values
- objExcel.Application.Cells(1, 3).Value = txtTuitNFees.Text
- objExcel.Application.Cells(2, 3).Value = txtBooksNSuppl.Text
- objExcel.Application.Cells(3, 3).Value = txtBoard.Text
- objExcel.Application.Cells(4, 3).Value = txtTransportation.Text
- objExcel.Application.Cells(5, 3).Value = txtOther.Text
- objExcel.Application.Cells(6, 3).Font.Bold = True
- 'Set up a cell to total the expenses
- objExcel.Application.Cells(6, 1).Formula = "=SUM(C1:C5)"
- 'Set total as the contents of this cell
- lblHoldTotal = objExcel.Application.Cells(6, 1).Value
- 'Make Excel invisible
- objExcel.Application.Visible = False
- End Sub
- Private Sub cmdQuit_Click()
- 'Close Excel
- objExcel.Application.Quit
- 'Release the object variable
- Set objExcel = Nothing
- End
- End Sub
-