N
Norman Yang
Hi Shauna:
I can not reply the message in the news group. I dont know why so I
post the new message about the code that reported with errors of the
usage of the user defined type.
Your example code works fine but I still can not find out the problem
in my code. Please help to check. The error line in the last.
Thanks
Norman
Public Type Pin_Pair
Pin_Name As String
Signal_Name As String
End Type
Public Type PAD
Pin_Seq_Num As String
Pad_Inst As String
Pin_Name As String
Pad_Type As String
Pad_Pull As String
Pad_Drive As String
Pad_Pin_Num As Integer ' the total pin muber of this PAD
Pad_Pin_List(1 To 20) As Pin_Pair
End Type
Public Const Start_Row As Integer = 2
Public Const End_Row As Integer = 256
Public Const Pin_Seq_Num_Col As Integer = 1
Public Const Pad_Inst_Col As Integer = 2
Public Const Pad_Type_Col As Integer = 3
Public Const Pin_Name_Col As Integer = 4
Public Const Pad_Pull_Col As Integer = 5
Public Const Pad_Drive_Col As Integer = 6
Public Pad_List(0 To 300) As PAD
Public VD33D_Signal_Name As String
Public VSSIO_Signal_Name As String
Public VD18D_Signal_Name As String
Public VSSCORE_Sgianl_Name As String
Public VSS_Signal_Name As String
Public Import_Log_File As Integer
Public Sub Set_Pad_Signal(ByRef this_pad As PAD)
With this_pad
If .Pad_Type = "VDD2D" Then
VDD2D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VDD1D" Then
VDD1D_Set_Signal (this_pad)
ElseIf Pad_Type = "VDD4D" Then
VDD4D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS1D" Then
VSS1D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS2D" Then
VSS2D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS3D" Then
VSS3D_Set_Signal (this_pad)
ElseIf .Pad_Type = "BIOHVU1" Then
BIOHVU1_Set_Signal (this_pad)
ElseIf .Pad_Type = "BIORU1" Then
BIOHVU1_Set_Signal (this_pad)
Else
.Pad_Pin_Num = 0
End If
End With
End Sub
Public Sub Import_Pin_List()
Dim i As Integer
Dim tmp_pad As PAD
Workbooks("Pin_Spec_for_VBA.xls").Activate
For i = Start_Row To End_Row
Pad_List(i).Pin_Seq_Num = Worksheets(2).Cells(i,
Pin_Seq_Num_Col).Value
Pad_List(i).Pad_Inst = Worksheets(2).Cells(i,
Pad_Inst_Col).Value
Pad_List(i).Pad_Type = Worksheets(2).Cells(i,
Pad_Type_Col).Value
Pad_List(i).Pin_Name = Worksheets(2).Cells(i,
Pin_Name_Col).Value
Pad_List(i).Pin_Name = Worksheets(2).Cells(i,
Pin_Name_Col).Value
Pad_List(i).Pad_Pull = Worksheets(2).Cells(i,
Pad_Pull_Col).Value
Pad_List(i).Pad_Drive = Worksheets(2).Cells(i,
Pad_Drive_Col).Value
Next
Set_Pad_Signal (Pad_List(2)) ' <<< Error will be reported here
End Sub
I can not reply the message in the news group. I dont know why so I
post the new message about the code that reported with errors of the
usage of the user defined type.
Your example code works fine but I still can not find out the problem
in my code. Please help to check. The error line in the last.
Thanks
Norman
Public Type Pin_Pair
Pin_Name As String
Signal_Name As String
End Type
Public Type PAD
Pin_Seq_Num As String
Pad_Inst As String
Pin_Name As String
Pad_Type As String
Pad_Pull As String
Pad_Drive As String
Pad_Pin_Num As Integer ' the total pin muber of this PAD
Pad_Pin_List(1 To 20) As Pin_Pair
End Type
Public Const Start_Row As Integer = 2
Public Const End_Row As Integer = 256
Public Const Pin_Seq_Num_Col As Integer = 1
Public Const Pad_Inst_Col As Integer = 2
Public Const Pad_Type_Col As Integer = 3
Public Const Pin_Name_Col As Integer = 4
Public Const Pad_Pull_Col As Integer = 5
Public Const Pad_Drive_Col As Integer = 6
Public Pad_List(0 To 300) As PAD
Public VD33D_Signal_Name As String
Public VSSIO_Signal_Name As String
Public VD18D_Signal_Name As String
Public VSSCORE_Sgianl_Name As String
Public VSS_Signal_Name As String
Public Import_Log_File As Integer
Public Sub Set_Pad_Signal(ByRef this_pad As PAD)
With this_pad
If .Pad_Type = "VDD2D" Then
VDD2D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VDD1D" Then
VDD1D_Set_Signal (this_pad)
ElseIf Pad_Type = "VDD4D" Then
VDD4D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS1D" Then
VSS1D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS2D" Then
VSS2D_Set_Signal (this_pad)
ElseIf .Pad_Type = "VSS3D" Then
VSS3D_Set_Signal (this_pad)
ElseIf .Pad_Type = "BIOHVU1" Then
BIOHVU1_Set_Signal (this_pad)
ElseIf .Pad_Type = "BIORU1" Then
BIOHVU1_Set_Signal (this_pad)
Else
.Pad_Pin_Num = 0
End If
End With
End Sub
Public Sub Import_Pin_List()
Dim i As Integer
Dim tmp_pad As PAD
Workbooks("Pin_Spec_for_VBA.xls").Activate
For i = Start_Row To End_Row
Pad_List(i).Pin_Seq_Num = Worksheets(2).Cells(i,
Pin_Seq_Num_Col).Value
Pad_List(i).Pad_Inst = Worksheets(2).Cells(i,
Pad_Inst_Col).Value
Pad_List(i).Pad_Type = Worksheets(2).Cells(i,
Pad_Type_Col).Value
Pad_List(i).Pin_Name = Worksheets(2).Cells(i,
Pin_Name_Col).Value
Pad_List(i).Pin_Name = Worksheets(2).Cells(i,
Pin_Name_Col).Value
Pad_List(i).Pad_Pull = Worksheets(2).Cells(i,
Pad_Pull_Col).Value
Pad_List(i).Pad_Drive = Worksheets(2).Cells(i,
Pad_Drive_Col).Value
Next
Set_Pad_Signal (Pad_List(2)) ' <<< Error will be reported here
End Sub