Please help about this error message.

N

Norman Yang

Hi All:

I have a simple VBA program like this, and the compiler reported error
on the calling of the "Set_Pad_Signal" in "Import_Pin_List". I can not
figure out what happens. Could you help me about this problem.

Thanks a lot.
Norman
(e-mail address removed)



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 Sub Set_Pad_Signal(this_pad As PAD)
' do nothing in this sub
'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
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

Import_Log_File = FreeFile
Open "Import.log" For Output As #Import_Log_File

Set_Pad_Signal (Pad_List(1)) '' <<--- Error is reported here
''--------------------------------------------------------------
' Errors are reported here. It is said that Pad_list is not a
variable,
' it is an expression.
'---------------------------------------------------------------
' Import_Log
Close #Import_Log_File

End Sub
 
P

Perry

What happens if you create a variable in Import_Pin_List(), like:
Dim tmp_Pad As PAD

and push the element of the typearray to this variable, like:
tmp_Pad = Pad_List(1)

Then pass this temp variable to subroutine Set_Pad_Signal, like:
Set_Pad_Signal(tmp_Pad)

-------------------------------------
Krgrds,
Perry

System parameters:
POS: WinXP x64
MSO: MSOffice System
DEV: VS7 (dotnet)
-------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top