Hi John,
First of all thank you for taking the time to help me.
Here is the code I typed: (I am getting this error message: Compile error
user-Defined type not defined)
in the code you'll see this line:
PlanID = .range("A:H").value
ParticipantCount = .range("G:H").Value
computedassetBalance = .range("F:H").Value
computedfee = .range("F:G").Value
because the range of PlanID, Computedfee, computedassetBalance and
computedfee fall in more than one cell. At the end of the code I put an
example of the excel sheet again to give you a better idea on how it looks.
Code
Private Sub Command0_Click()
Dim oBook As Excel.Workbook
Dim oSheet
Dim RS As DAO.Recordset
Dim PlanId As String
Dim ParticipantCount As Long
Dim computedassetBalance As Long
Dim computedfee As Long
'Open worksheet
Set oBook = GetObject("C:\MyDocument\Test.xls")
Set oSheet = oBook.Worksheets("Test")
With oSheet
'get values
PlanId = .range("A:H").Value
ParticipantCount = .range("G:H").Value
computedassetBalance = .range("F:H").Value
computedfee = .range("F:G").Value
End With
'close workbook
oBook.Close False
'append new record to table
Set RS = CurrentDb.OpenRecordset("Table1")
With RS
.AddNew
.Fields("PlanID").Value = PlanId
.Fields("ParticipantCount").Value = ParticipantCount
.Fields("ComputedatassetBalance").Value = CpmBalance
.Fields("computedfee").Value = CmpuFee
.Update
.Close
End With
End Sub
Here is part of the Excel Sheet
Internal Summary Report 7/18/2006
Plan ID: xxx Namebbbbbbbbbb
Report period: 4/01/2006 to 6/30/2006
Run date: 7/18/2006 2:29:49PM
Fee schedule: 75BP/4500 75BP / 4500 Annual
Fees processed by division: No
Activity Fees
Activity fees are paid from plan assets: No
Distribution fee amount: $0.00 Count: 1 Amount due: $0.00
Loan fee amount: $0.00 Count: 0 Amount due: $0.00
Transfer fee amount: $0.00 Count: 0 Amount due: $0.00
Withdrawal fee amount: $0.00 Count: 0 Amount due: $0.00
Computed fee: $0.00
Administrative Fees
Administrative fees are paid from plan assets: No
Fee prorated for report period: No
Base administration fee: $1,125.00
"Plan asset level for waiver of base
administration fee:"
$0.00
Prorated administration fee: $1,125.00
Assess fee to participant if balance
greater than: $0.00
Fee is per participant: No
Administrative fee type: Count
Fee rate: $0.00
Participant count: 130
Computed fee: $0.00
Loan maintenance fee: $0.00
Number of loans: 0
Total loan maintenance fee: $0.00
Asset Fees
Asset fees are paid from plan assets: No
Fee prorated for report period: No
Minimum asset fee assessed: $0.00
Computed asset balance: $1,445,365.99
Asset calculation method: Exclusive
Rate: 0.001875 basis points
Computed fee: $2,710.06
General Fees
General fees are paid from plan assets: No
Fee prorated for report period: No
Managed Account Fee: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Plan ID: 1231NameCCCCCCCCCCCCCCCCCCCCc
Report period: 4/01/2006 to 6/30/2006
Run date: 7/18/2006 2:29:49PM
Fee schedule: 75BP/4500 75BP / 4500 Annual
Fees processed by division: No
Request ID: 92463
Plan Summary
Total activity fees: $0.00
Total administrative fees: $1,125.00
Total asset fees: $2,710.06
Total general fees: $0.00
Grand total: $3,835.06
Amount paid from plan assets: $0.00
Net amount due: $3,835.06
Plan ID: 169 Quad-C Management, Inc. 401(k) Profit Sharing Plan
Report period: 4/01/2006 to 6/30/2006
Run date: 7/18/2006 2:29:49PM
Fee schedule: 48BP/5333 48BP / 5333.33
Fees processed by division: No
Activity Fees
Activity fees are paid from plan assets: No
Distribution fee amount: $0.00 Count: 0 Amount due: $0.00
Loan fee amount: $0.00 Count: 0 Amount due: $0.00
Transfer fee amount: $0.00 Count: 0 Amount due: $0.00
Withdrawal fee amount: $0.00 Count: 0 Amount due: $0.00
Computed fee: $0.00
Administrative Fees
Administrative fees are paid from plan assets: No
Fee prorated for report period: No
Base administration fee: $1,333.33
"Plan asset level for waiver of base
administration fee:"
$0.00
Prorated administration fee: $1,333.33
Assess fee to participant if balance
greater than: $0.00
Fee is per participant: No
Administrative fee type: Count
Fee rate: $0.00
Participant count: 27
Computed fee: $0.00
Loan maintenance fee: $0.00
Number of loans: 0
Total loan maintenance fee: $0.00
Asset Fees
Asset fees are paid from plan assets: No
Fee prorated for report period: No
Minimum asset fee assessed: $0.00
Computed asset balance: $2,388,263.51
Asset calculation method: Exclusive
Rate: 0.001200 basis points
Computed fee: $2,865.92
General Fees
General fees are paid from plan assets: No
Fee prorated for report period: No
Managed Account Fee: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
Fee description: Schedule amount: $0.00 Computed amount: $0.00
[quoted text clipped - 62 lines]
Please respond in the newgroup and not by email.