User-defined Type Not Defined
Having a problem trying to retrieve data from a recordset. The field programmer_name is to be used to populate a combo box. The table name is programmer. I keep getting an error stating that the user defined type is not defined. Can anyone help???? I have posted the relevant code below.
Private Sub cmbprogrammer_DropDown()
'Declarations Dim rs As ADODB.Recordset Dim Con As ADODB.Connection Dim ssql As String
'Code:
Set Con = New ADODB.Connection Set rs = New ADODB.Recordset Con.Open strCon 'sql statement to select items on the drop down list ssql = "Select Programmer_Name From Programmer" rs.Open ssql, Con
Do Until rs.EOF cmbprogrammer.AddItem rs(programmer_name) 'Adds lastnames to dropdown list rs.MoveNext Loop
'Close connection and the recordset rs.Close Set rs = Nothing Con.Close Set Con = Nothing
End Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
...event Property Setting Produced The Following Error: User-defined Type Not Defined
Help!!
I copied the class module, form, and table objects from a working database (A) to another database (B) already containing class modules, forms, and tables.
When I run my form, I get the error "the expression On Click you entered as the event property setting produced the following error: User-defined type not defined."
I tried removing the problem event and got the same error with each event in the form.
Any thoughts?
User Defined Type Not Defined : StdPicture. Works In The Demo, What Am I Missing?
Public Function CreateFromPicture(ByRef picThis As StdPicture)
I'm trying to save a file picture as a jpg, but get the error : "User
defined type not defined" on the first line in this post. When I
type "picThis As Std" I don't get the choice StdPicture. Why not?
Here's where I got the code for saving to jpg:
http://www.vbaccelerator.com/codelib/gfx/vbjpeg.htm
Omg, this should be simple, what am I missing here? It works in the demo file so what the heck am I doing wrong?
Class Property That Is An Array And Is Defined As A User Defined Type
How is this done in VB?
I can not figure out how to get this to work and then assign values to it.
Here is what I have so far:
Code:
Private Type ScriptParameter
Variable As String
Value As String
End Type
Private mvarCMS_Script_Number_Of_Parameters As Long 'local copy
Private mvarCMS_Script_Parameters() As ScriptParameter 'local copy
Friend Property Let CMS_Script_Number_Of_Parameters(ByVal vData As Long)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.CMS_Script_Name = 5
mvarCMS_Script_Number_Of_Parameters = vData
ReDim Preserve mvarCMS_Script_Parameters(mvarCMS_Script_Number_Of_Parameters)
End Property
Friend Property Get CMS_Script_Number_Of_Parameters() As Long
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.CMS_Script_Name
CMS_Script_Number_Of_Parameters = mvarCMS_Script_Number_Of_Parameters
End Property
Friend Property Let CMS_Script_Parameters(Index As Long, VData as ScriptParameter)
'used when assigning a value to the property, on the left side of an assignment.
'Syntax: X.CMS_Script_Parameters = 5
If (Index + 1) > mvarCMS_Script_Number_Of_Parameters Then
Err.Description = "The CMS_Script_Parameters(" & Index & ") does not exist. Only " & _
mvarCMS_Script_Number_Of_Parameters & " have been defined."
GoTo HandleError
End If
mvarCMS_Script_Parameters(Index) = vData
Exit Property
HandleError:
ERROR_DESCRIPTION = "There was a problem setting a CMS_Script_Parameters property: " _
& Err.Description
End Property
Friend Property Get CMS_Script_Parameters(Index As Long) As ScriptParameter
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.CMS_Script_Parameters
If (Index + 1) > mvarCMS_Script_Number_Of_Parameters Then
Err.Description = "The CMS_Script_Parameters(" & Index & ") does not exist. Only " & _
mvarCMS_Script_Number_Of_Parameters & " have been defined."
GoTo HandleError
End If
CMS_Script_Parameters = mvarCMS_Script_Parameters(Index)
Exit Property
HandleError:
Err.Description = "There was a problem retrieving a CMS_Script_Parameters property: " _
& Err.Description
Err.Raise 9999
End Property
Then i have the following to assign values:
Code:
Dim test As clsCMSScripting
Set test = New clsCMSScripting
With test
.CMS_Script_Number_Of_Parameters = 1
.CMS_Script_Parameters(0).Variable = "&&DATES&&"
.CMS_Script_Parameters(0).Value = "9/2/03"
End With
But of course, it is not working.....I have tried 4 or 5 variations...andI am starting to get frustrated : )
Help please!! : )
Help Keep Gettin Error Message User Defined Type Not Defined
This is the code i have atm,i am getting vb to look into a db to find a username and password and then log a user in but i keep getting an error message.
Code:
Public conConnection As New ADODB.Connection
Public cmdCommand As New ADODB.Command
Public rstRecordSet As New ADODB.Recordset
Private Sub Form_Load()
conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
App.Path & "" & "ivadb.mdb;Mode=Read|Write"
End Sub
Private Sub cmdlogin_Click()
conConnection.CursorLocation = adUseClient
conConnection.Open
With cmdCommand
.ActiveConnection = conConnection
.CommandText = "SELECT * FROM Member WHERE Username = '" & txtusername.Text & "' AND Password = '" & txtpassword.Text & "';"
.CommandType = adCmdText
End With
With rstRecordSet
.CursorType = adOpenStatic
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open cmdCommand
End With
If rstRecordSet.EOF = False Then
rstRecordSet.MoveFirst
MsgBox "Logged in, thanks."
frmmemberhome.Show
Else
MsgBox "Not logged in, sorry."
End If
conConnection.Close
End Sub
[RESOLVED ] Compiler ERROR: User-defined Type Not-defined
I used this declaration and got an error. How do i declare it?
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
when i used it in a new form it didn't complain?
thanks,
stash
Edited by - stash on 1/20/2007 8:07:37 AM
Dim P As Printer -> User-defined Type Not Defined Error :-|
Hi, I need this code to work in my Visual basic for applications project:
Dim p As Printer
For Each p In Printers
If p.DeviceName = crxRpt.PrinterName Then
crxRpt.SelectPrinter p.DriverName, p.DeviceName, p.Port
Exit For
End If
Next p
but the first line raises the User-defined type not defined error... plase have someone something that could help me?
Thanks, B. Riha.
Excel VBA Error: User Defined Type Not Defined
I'm getting an error and I can't find the source of it. I have an excel spreadsheet with several VBA modules, all work fine. Occasionally, ususally soon after I open the file for the first time, when I calculate (F9), I get an error message " User Defined Type Not Defined ". However, the source of the error is not highlighted in the VBA editor. If I hit F9 again immediately, I do not get the error, and usually don't get the error ever again that day. I'm declaring probably close to 100 variables, most of them Public, but can't find the one that is causing the problem (if indeed the error is in declaring a variable incorrectly). Any ideas??
Eric
User Defined Type Not Defined - Compile Error
Hi All,
I am trying to Compile a VB program, I am getting this Error "Compile error - User defined type not defined"
I know it should be one of the Project references i need to set, but i am not sure which one it is.. Appreciate your help.
Thanks
Compile Error User Defined Type Not Defined
Hi! I need help with a project that I am developing using VB6 and SQL Server. I am setting up a connection that will allow my program to find a file on the network and delete it. I have the following declartions at the top of my form:
Public oConn A Nw ADODB.connection (in my code module where I build the connection)
Public rs As Recordset (in my main form, to find the pathname I need for the delete)
When I try to run, I get the error:
Compile error: User-defined type not defined
I do not understand what is happening as these shouldn't be considered user-defined types. If you have any ideas, please help!
Thanks!
Compile Error: User-defined Type Not Defined
OK this same code was working for me before but not I have created a New project and inserted the code in MDI form I get this error
Compile error: User-defined Type Not Defined
and it highlights this section of the code
New ADODB.Connection
code is:
Set cnn = New ADODB.Connection
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "data.mdb" & ";Persist Security Info=False"
cnn.Open
'This will set rs as Access recordset(Table)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
User Defined Type Not Defined Error Due To StdPicture
Please help. I am using the clipboard to paste an image into a richtextbox. I have found some documentation on how to achieve this but I am unable to compile.
Here is the code I have:
Public Sub InsertPictureInRichTextBox(RTB As RichTextBox, Picture As StdPicture) 'Here is where I receive the error due to Picture as StdPicture
Clipboard.Clear
Clipboard.SetData Picture
SendMessage RTB.hwnd, WM_PASTE, 0, 0
End Sub
Private Sub Form_Load()
Open AnalFileName$ For Output As #1
Print #1, "This is a test of Text above a graphic"
InsertPictureInRichTextBox AnalOutput.Out, "C:Documents and SettingsOwnerDesktopstrakeInWindTunnel.bmp"
Print #1, "This is TEXT BELOW the graphic"
Close #1
AnalOutput.Out.LoadFile AnalFileName$, 1
End Sub
Thanks in advance for your help.
Compile Error: User-defined Type Not Defined??
Private Declare Function Netbios Lib "netapi32" _
(pncb As NET_CONTROL_BLOCK) As Byte
This is the String of Code that gives me the following Error Message
Compile Error: User - Definded type not Defined
Thxs in Advance...
User Defined Type Not Defined - Compile Error
Hi All,
I am trying to Compile a VB program, I am getting this Error "Compile error - User defined type not defined"
I know it should be one of the Project references i need to set, but i am not sure which one it is.. Appreciate your help.
Thanks
User Defined Type Not Defined - Compile Error
Hi All,
I am trying to Compile a VB program, I am getting this Error "Compile error - User defined type not defined"
I know it should be one of the Project references i need to set, but i am not sure which one it is.. Appreciate your help.
Thanks
User Defined Type - Error Variable Not Defined
VB Code:
Private Type userinfo id As Integer uname As StringEnd Type Private userinfo As userinfo Private Sub Command1_Click() Label1.Caption = userinfo.idLabel2.Caption = userinfo.unameEnd Sub Private Sub Form_Load() userinfo.id = 1 userinfo.uname = "stephen" Form1.Caption = userinfo.unameEnd Sub
This is related to scope. In Form Load, you declared an instance of userinfo (called userinfo). This variable is only 'visible' within Form Load. In the click event you've declared another (new) instance of the data type, also called userinfo. But since both these variables have been declared in separate procedures they are private. As a result Form Load cannot 'see' the instance declared in the click event and vice versa. In effect in the click event you referred to an instance of userinfo that is brand new with no data in it
VisData Error: :user-defined Type NOT Defined?
Well as u may have guessed i'm new to VB. Not new to Pascal though. Anyway, I've used VisData to create a new DB and a new table. Along with a "dandy" lookin' Data-Aware form.
Problem:
- After setting the created Data-Aware form as the "StrtUp" form in project properties. I ran the form.
- I then added a "dummy" record via the fields in the form.
(or @ least i tried to...)
-Upon hitting the "ADD" button which the VisData Man. created (amongst others, i get an error msg as follows:
"USER DEFINED-TYPE NOT DEFINED."
-Upon pressing "DEBUG", the code-window reveals a highlited sub: PRIVATE SUB datPrimaryRS_...(...) ?
In other words, nothing is being "ADDED", "UPDATED" etc.
Q: What stupid thing am i Not doing? Seeing i am a novice @ VB?
P.S: I thought that VB was much simplier to use w/ DB's.
Aren't the event procedures that's generated fully functional & equipped to handle FUNDAMENTAL operations???
-
Compile Error: User-defined Type Not Defined
I'm running Windows 2000 and I cannot compile dll's that are able to be compiled on NT machines. The compile error: user-defined type not defined is raised when referencing an MTS object. Does anybody know if there are issues with this in Windows 2000? I've tried adding project references as suggested in other posts, but it doesn't seem to make a difference. Thanks.
Error: User- Defined Type Not Defined
It is my first trail using Direct Sound….
I have been trying all the last night to get rid of this Error Message:
Compile error:
User- defined type not defined
After responding to this message this line of my code is highlighted:
Dim DSBuffer(1) As DirectSoundBuffer
I am attaching my project file. So please tell me what's wrong and how to solve it.
Thanks,
Mamoun
User Defined Type Not Defined Error
Hi guys,
I am attempting to add some code to a program to send email with smtp using ostrosoft.com's smtp component, everthing works find when I run the code on its own but when I add it into by existing script I get the error,
"Complie error
User defined type not defined"
with the line the I have added in the general declarations section,
"Public WithEvents oSMTP As OSSMTP.SMTPSession"
any ideas what I need to add or have done wrong?
thx
Dim Fs As New FileSystemObject User Defined - Type Not Defined
Hi
Can you please tell me how can I resolve this problem
when i try to run the program appears asn error like this
Dim fs As New FileSystemObject
User defined - type not defined
I pasted de code into my form so I'm not able to know what is wrong with this code.
I really apreciate if you could help me
Teixeira
User Defined Type Not Defined Error
I have the same problem as this post. Here is my code:
Code:
Option Explicit
Dim WithEvents oSMTP As OSSMTP.SMTPSession
Private Sub btnAddAttachment_Click()
frmAddAttachment.Show vbModal, Me
If frmAddAttachment.txtFile.Text <> "" Then lstAttachments.AddItem frmAddAttachment.txtFile.Text
Unload frmAddAttachment
End Sub
Private Sub btnDelAttachment_Click()
If lstAttachments.ListIndex > -1 Then lstAttachments.RemoveItem lstAttachments.ListIndex
End Sub
Private Sub btnSendEmail_Click()
txtStatus.Text = ""
With oSMTP
'connection
.Server = txtServer.Text
'authentication
.AuthenticationType = ddlAuthenticationType.ListIndex
If txtUsername.Text <> "" Then .Username = txtUsername.Text
If txtPassword.Text <> "" Then .Password = txtPassword.Text
If txtPOPServer.Text <> "" Then .POPServer = txtPOPServer.Text
'message
.MailFrom = txtMailFrom.Text
.SendTo = txtSendTo.Text
.MessageSubject = txtMessageSubject.Text
.MessageText = txtMessageText.Text
'attachments
Dim i As Integer
For i = 0 To lstAttachments.ListCount - 1
.Attachments.Add (CStr(lstAttachments.List(i)))
Next
'send email
.SendEmail
End With
End Sub
Private Sub ddlAuthenticationType_Click()
Select Case ddlAuthenticationType.ListIndex
Case OSSMTP.authentication_type.AuthNone
txtUsername.Enabled = False
txtUsername.Text = ""
txtPassword.Enabled = False
txtPassword.Text = ""
txtPOPServer.Enabled = False
txtPOPServer.Text = ""
Case OSSMTP.authentication_type.AuthPOP
txtUsername.Enabled = True
txtPassword.Enabled = True
txtPOPServer.Enabled = True
Case OSSMTP.authentication_type.AuthLogin, OSSMTP.authentication_type.AuthNone
txtUsername.Enabled = True
txtPassword.Enabled = True
txtPOPServer.Enabled = False
txtPOPServer.Text = ""
End Select
End Sub
Private Sub Form_Load()
Set oSMTP = New OSSMTP.SMTPSession
With ddlAuthenticationType
.AddItem ("None")
.AddItem ("POP3")
.AddItem ("AUTH LOGIN")
.AddItem ("AUTH PLAIN")
End With
ddlAuthenticationType.ListIndex = 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set oSMTP = Nothing
End Sub
Private Sub oSMTP_ErrorSMTP(ByVal Number As Integer, Description As String)
txtStatus.Text = txtStatus.Text & "Error " & Number & ": " & Description & vbCrLf
End Sub
Private Sub oSMTP_StatusChanged(ByVal Status As String)
txtStatus.Text = txtStatus.Text & oSMTP.Status & vbCrLf
End Sub
But I get the same error User defined type not definedand but in form I did Set oSMTP = New OSSMTP.SMTPSession so what did I do wrong here?
'User Defined Type Not Defined' Error Using ADO
I am trying to establish a connection to an Access database using ADO in VB5. When I run the code, I get a compile error saying 'User Defined Type Not Defined.' Below is the code:
Private Sub Form_Load()
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:cw2004utilscw_97.mdb;"
MyConn.Open
Set MyRecSet = MyConn.Execute("SELECT r_name FROM roster")
Do Until MyRecSet.EOF
lst_moves.AddItem = MyRecSet.Fields.Item("r_name").Value
MyRecSet.MoveNext
Loop
MyConn.Close
End Sub
-----------------------
The first line,
Dim MyConn As ADODB.Connection
is the line that gets highlighted by VB when I try to debug.
Any ideas?
User-defined Type Not Defined Error
I've used the app. wizard to do a quick app for viewing & editing an Access97 DB file. When I run the app in design view, I get an error 'User-Defined type not defined".
and it highlights
Code:
Private Sub datPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
I've searched MSDN and it says I must include microsoft DAO 3.51. I've done this and it doesn't work. Any suggestions?
My provider string is: "PROVIDER=Microsoft.Jet.OLEDB.3.51"
Problem: User-defined Type Not Defined
Hi
here is the sample code that performs user login function. when i press Run it shows a message "User-defined type not defined" and it highlights the cnContacts As ADODB.connection. Please guide me what to do since i'm a beginner in VB
Code:
Private Sub Login_Click()
Dim dbFile As String
Dim cnContacts As ADODB.connection
Dim psd As String
'------- Set the database Application Path ------
dbFile = App.Path & "DATABASE.mdb"
'----------- Establish the connection -----------
Set cnContacts = New ADODB.connection
cnContacts.CursorLocation = adUseClient
cnContacts.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & "Data Source=" & dbFile & ";" & "Persist Security Info=False"
'-------------- Open the connection -------------
cnContacts.Open
'---------- Get The Record For Administrator-------
psd = "SELECT PASSWORD FROM Administrator WHERE ADMIN_ID = '&AdminID.text'"
'----------testing login-------------
If (AdminID.Text = psd) Then
MsgBox "Access Granted", vbOKOnly
Else
MsgBox "Access Denied", vbOKOnly
End If
cnContacts.Close
Set cnContacts = Nothing
End Sub
ADOX ... User-defined Type Not Defined
i was trying to see what the following does:
Code:
Option Explicit
Dim cat As ADOX.Catalog
Dim tbl As ADOX.Table
Private Sub Command1_Click()
Set cat = New ADOX.Catalog
Set tbl = New ADOX.Table
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:
ewDB.mdb"
With tbl
.Name = "TestTable"
With .Columns
.Append "ID COLUMN"
.Append "SetName", adVarWChar, 255
.Append "SetVal", adVarWChar, 255
.Append "Description", adVarWChar, 255
End With
End With
cat.Tables.Append tbl
Set cat = Nothing
Set tbl = Nothing
End Sub
but it bugs out on line 1
ADOX ... user-defined type not defined
cant seem to find the right reference in the component list. anybody know the name of the dll that makes adox work?
User-defined Type Not Defined (ActiveX DLL)
I am trying to create my first ActiveX DLL and I am getting a "User-defined type not defined" when I try to run within the IDE but it seems to work when I compile and then run the compiled project.
The DLL is returning a Public Function. This is what I did in my form:
VB Code:
Option Explicit[hl]Private objTaxCalc As clsTaxCalc.DllGetSalesTaxForWizard[/hl] Private Sub MDIForm_Load() Set objTaxCalc = New clsTaxCalc.DllGetSalesTaxForWizardEnd Sub
The DLL of course, created a class module and I called it clsTaxCalc. I have never done this before so I do not know why I am getting the error on the highlighted line. The public function in the DLL is called GetSalesTaxForWizard
Error User Defined Type Not Defined
This is extremely odd...
I have the module for DirectShow for playing music, and it will not work. It gives me the error: User defined type not defined.
I added DirectX7 to my references I don't know whats wrong.
Here is the module code:
VB Code:
Option Explicit Private Const MAX_VOLUME As Long = 100Private Const MAX_BALANCE As Long = 100Private Const MAX_SPEED As Long = 226 Public DirectShow_Event As IMediaEventPublic DirectShow_Control As IMediaControlPublic DirectShow_Position As IMediaPositionPublic DirectShow_Audio As IBasicAudioPublic DirectShow_Video As IBasicVideoPublic DirectShow_Video_Window As IVideoWindow Public Video_Media As BooleanPublic Video_Running As BooleanPublic Fullscreen_Enabled As BooleanPublic Fullscreen_Width As LongPublic Fullscreen_Height As Long Public Function DirectShow_Load_Media(File_Name As String) As Boolean On Error GoTo Error_Handler If Right(File_Name, 4) = ".mp3" Then Video_Media = False Set DirectShow_Control = New FilgraphManager DirectShow_Control.RenderFile (File_Name) Set DirectShow_Audio = DirectShow_Control DirectShow_Audio.Volume = 0 DirectShow_Audio.Balance = 0 Set DirectShow_Event = DirectShow_Control Set DirectShow_Position = DirectShow_Control DirectShow_Position.Rate = 1 DirectShow_Position.CurrentPosition = 0 ElseIf Right(File_Name, 4) = ".mpeg" Or _ Right(File_Name, 4) = ".mpg" Or _ Right(File_Name, 4) = ".avi" Or _ Right(File_Name, 4) = ".mov" Then Video_Media = True Set DirectShow_Control = New FilgraphManager DirectShow_Control.RenderFile (File_Name) Set DirectShow_Audio = DirectShow_Control DirectShow_Audio.Volume = 0 DirectShow_Audio.Balance = 0 If Fullscreen_Enabled = True Then Set DirectShow_Video_Window = DirectShow_Control DirectShow_Video_Window.WindowStyle = CLng(&H6000000) DirectShow_Video_Window.Top = 0 DirectShow_Video_Window.Left = 0 DirectShow_Video_Window.Width = Fullscreen_Width DirectShow_Video_Window.Height = Fullscreen_Height DirectShow_Video_Window.Owner = frmMain.hwnd Else Set DirectShow_Video_Window = DirectShow_Control DirectShow_Video_Window.WindowStyle = CLng(&H6000000) DirectShow_Video_Window.Top = 0 DirectShow_Video_Window.Left = 0 DirectShow_Video_Window.Width = frmMain.ScaleWidth DirectShow_Video_Window.Height = frmMain.ScaleHeight DirectShow_Video_Window.Owner = frmMain.hwnd End If Set DirectShow_Event = DirectShow_Control Set DirectShow_Position = DirectShow_Control DirectShow_Position.Rate = 1 DirectShow_Position.CurrentPosition = 0 Else GoTo Error_Handler End If DirectShow_Load_Media = True Exit FunctionError_Handler: DirectShow_Load_Media = False End Function Public Function DirectShow_Play() As Boolean On Error GoTo Error_Handler If Video_Media = True Then Video_Running = True DirectShow_Control.Run DirectShow_Play = True Exit Function Error_Handler: DirectShow_Play = False End Function Public Function DirectShow_Stop() As Boolean On Error GoTo Error_Handler If Video_Media = True Then Video_Running = False Video_Media = False End If DirectShow_Control.Stop DirectShow_Position.CurrentPosition = 0 DirectShow_Stop = True Exit Function Error_Handler: DirectShow_Stop = False End Function Public Function DirectShow_Pause() As Boolean On Error GoTo Error_Handler DirectShow_Control.Stop DirectShow_Pause = True Exit FunctionError_Handler: DirectShow_Pause = False End Function Public Function DirectShow_Volume(ByVal Volume As Long) As Boolean On Error GoTo Error_Handler If Volume >= MAX_VOLUME Then Volume = MAX_VOLUME If Volume <= 0 Then Volume = 0 DirectShow_Audio.Volume = (Volume * MAX_VOLUME) - 10000 DirectShow_Volume = True Exit FunctionError_Handler: DirectShow_Volume = False End Function Public Function DirectShow_Balance(ByVal Balance As Long) As Boolean On Error GoTo Error_Handler If Balance >= MAX_BALANCE Then Balance = MAX_BALANCE If Balance <= -MAX_BALANCE Then Balance = -MAX_BALANCE DirectShow_Audio.Balance = Balance * MAX_BALANCE DirectShow_Balance = True Exit FunctionError_Handler: DirectShow_Balance = False End Function Public Function DirectShow_Speed(ByVal Speed As Single) As Boolean On Error GoTo Error_Handler If Speed >= MAX_SPEED Then Speed = MAX_SPEED If Speed <= 0 Then Speed = 0 DirectShow_Position.Rate = Speed / 100 DirectShow_Speed = True Exit Function Error_Handler: DirectShow_Speed = False End Function Public Function DirectShow_Set_Position(ByVal Hours As Long, ByVal Minutes As Long, ByVal Seconds As Long, Milliseconds As Single) As Boolean On Error GoTo Error_Handler Dim Max_Position As Single Dim Position As Double Dim Decimal_Milliseconds As Single 'Keep minutes within range Minutes = Minutes Mod 60 'Keep seconds within range Seconds = Seconds Mod 60 'Keep milliseconds within range and keep decimal Decimal_Milliseconds = Milliseconds - Int(Milliseconds) Milliseconds = Milliseconds Mod 1000 Milliseconds = Milliseconds + Decimal_Milliseconds 'Convert Minutes & Seconds to Position time Position = (Hours * 3600) + (Minutes * 60) + Seconds + (Milliseconds * 0.001) Max_Position = DirectShow_Position.StopTime If Position >= Max_Position Then Position = 0 GoTo Error_Handler End If If Position <= 0 Then Position = 0 GoTo Error_Handler End If DirectShow_Position.CurrentPosition = Position DirectShow_Set_Position = True Exit FunctionError_Handler: DirectShow_Set_Position = False End Function Public Function DirectShow_End() As Boolean On Error GoTo Error_Handler If DirectShow_Loop = False Then If DirectShow_Position.CurrentPosition >= DirectShow_Position.StopTime Then DirectShow_Stop End If DirectShow_End = True Exit FunctionError_Handler: DirectShow_End = False End Function Public Function DirectShow_Loop() As Boolean On Error GoTo Error_Handler If DirectShow_Position.CurrentPosition >= DirectShow_Position.StopTime Then DirectShow_Position.CurrentPosition = 0 End If DirectShow_Loop = True Exit FunctionError_Handler: DirectShow_Loop = False End Function Public Sub DirectShow_Shutdown() Set DirectShow_Video_Window = Nothing Set DirectShow_Position = Nothing Set DirectShow_Event = Nothing Set DirectShow_Audio = Nothing Set DirectShow_Control = Nothing End Sub
Here is the error message screen shot:
User-defined Type Not Defined && Crystal RPT
Hi all,
I posted a question about how to use Crystal Report, and I
got a sample from DavidRobin, but I could not figure it out.
I paste the code he provided, but it would not compile. The
compiler is complaining that the User-defined type not defined and the lines it does not like are the two
dims below:
Dim Appl As CRAXDRT.Application
Dim Report As New CRAXDRT.Report
What Project->References or Project->Components must I
attach?
Here is the sample code David provided:
' holds the report file path
Private mRepFile As String
Private Sub Form_Load()
Set Appl = New CRAXDRT.Application
Set Report = Appl.OpenReport(mRepFile)
Report.DiscardSavedData
Report.Database.Tables(1).SetLogOnInfo <database>, , <UserID>, <password>
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
CRViewer1.Top = 0
CRViewer1.Left = 0
End Sub
Private Sub Form_Resize()
' keeps the CRViewer the same size as the form
CRViewer1.Width = Me.ScaleWidth
CRViewer1.Height = Me.ScaleHeight
End Sub
' Property to allow the report path to be passed in
Property Let ReportFile(rep As String)
mRepFile = rep
End Property
Private Sub Form_Unload(Cancel As Integer)
Set Appl = Nothing
Set Report = Nothing
End Sub
Private Sub mnuOutstanding_Click()
frmReportView.ReportFile = App.Path & "Students.rpt"
frmReportView.Caption = "Crystal Report Viewer [Students.rpt]"
frmReportView.Show vbModal
frmReportView.ReportFile = ""
Set frmReportView = Nothing
End Sub
User-defined Type Not Defined Error
Hello, I was wondering if you guys could help me.
Whenever I try and compile my code I'm receiving the User-defined type not defined error for the following line:
Code:
Dim style As MsgBoxStyle
Im trying to create a Yes/No prompt box and I believe I haven't got the right reference included in my project. Does anyone know which reference I need to include for prompt boxes or this style?
Thanks very much
Code below:
Code:
Dim MSG As String
Dim title As String
Dim style As MsgBoxStyle
Dim response As MsgBoxResult
MSG = "Do you wish to print off debtor notes?" ' Define message.
style = MsgBoxStyle.DefaultButton1 Or _
MsgBoxStyle.Question Or MsgBoxStyle.YesNo
title = "Print notes?" ' Define title.
'Display message.
response = MsgBox(MSG, style, title)
Error :User-defined Type Not Defined
Hi,
Below is the source code I write in module:
Type typeAuthor
AU_ID As Long
Author As String * 255
End Type
Declare Sub hmemcpy Lib "KERNEL" (dest As Any, src As Any, ByVal Size As Long)
Function GetCurrRec(ds As Dynaset) As String
Dim i As Integer
Static FieldStr As String
Static recStr As String
recStr = ""
For i = 0 To ds.Fields.Count - 1
FieldStr = Space(ds.Fields(i).Size)
Select Case ds.Fields(i).Type
Case 1, 2 'Bytes
hmemcpy ByVal FieldStr, CInt(ds.Fields(i).Value), ds.Fields(i).Size
Case 3 'Integers
hmemcpy ByVal FieldStr, CInt(ds.Fields(i).Value), ds.Fields(i).Size
Case 4 'Long integers
hmemcpy ByVal FieldStr, CLng(ds.Fields(i).Value), ds.Fields(i).Size
Case 5 'Currency
hmemcpy ByVal FieldStr, CCur(ds.Fields(i).Value), ds.Fields(i).Size
Case 6 'Singles
hmemcpy ByVal FieldStr, CSng(ds.Fields(i).Value), ds.Fields(i).Size
Case 7, 8 'Doubles
hmemcpy ByVal FieldStr, CDbl(ds.Fields(i).Value), ds.Fields(i).Size
Case 9, 10 'String types
hmemcpy ByVal FieldStr, ByVal CStr(ds.Fields(i).Value), Len(ds.Fields(i).Value)
Case 11, 12 'Memo and long binary
FieldStr = ds.Fields(i).GetChunk(0, ds.Fields(i).FieldSize())
End Select
recStr = recStr & FieldStr
Next
GetCurrRec = recStr
End Function
When I try to compile, the error occur user-defined type not defined which show to the line code (Function GetCurrRec(ds As Dynaset) As String). What is happening??Pls help me
Thanks
User Defined Type Not Defined
Hi,
I am writing some code that looks like this:
Option Compare Database
Option Explicit
Private Sub TxtFile_AfterUpdate()
Me.Refresh
End Sub
Private Sub TxtAcct_AfterUpdate()
Me.Refresh
End Sub
Private Sub CmdSearch_Click()
Dim dbs As Database
Dim rstFinLkup As Recordset
Set dbs = CurrentDb
Set rstFinLkup = dbs.OpenRecordset("tblFinancialLookUp")
Lbl1.Caption = " "
Lbl1.FontBold = True
rstFinLkup.Index = "SK1"
rstFinLkup.Seek "=", TxtFile, TxtAcct, TxtDept, TxtProd, TxtCat, TxtBox
If rstFinLkup.NoMatch Then
Lbl1.Caption = "No percent for this combination"
Else
TxtPercent = rstFinLkup!PercentUsed
End If
On executing, however, I get the error "User defined type not defined" where I have "Set dbs = CurrentDb". I think that there is some conflict in using Me. and dbs. Please help me to resolve...
Thanks
Z
User Defined Type Not Defined
Hi all,
I have an Access (2003) program with 10 forms. On the last form that I have added, the code works great, but I decided to add a Form_Load event that would display a message to the user. I created the Form_Load event, and copied the code from another form in the same database (the code works like a charm in that other form), I tried to run the program, and the following error message comes up:
________________________________________________________________
The expression On Load you entered as the event property setting produced the following error: User-defined type not defined.
* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
* There may be an error evaluating the function, event, or macro.
________________________________________________________________
So I commented out the code, and ran it with just the tags...
Private Sub Form_Load()
End Sub
...and I still get the same error. This is a first for me. I looked on line at the microsoft site to determine what to do, but couldn't find the exact situation documented, so I thought to write here.
Has anyone had this happen before?
Thanks,
Richs
User-defined Type Not Defined?
Hi all,
I have a project group that contains a standard exe two com+ objects and an OCX project.
I also have a fault just recently found whereby the use of an enumerated user type generates a message "User-defined type not defined" when I try to run the project (the user type is defined in one of the com objects and I am using it from the Exe). All four projects are in the IDE so that I can single-step through the code while I am debugging.
This is only a recent error, it has been working fine up untill I added the OCX project to the group. I have found a workround whereby I go into the exe's project-references, uncheck the references to the com object, exit references an then go back in to check it again. When I exit VB completely and go back in, I have the error again.
I am wondering If I am seeing a side effect to a maximum files limit scenario?
My first three projects have a total of 118 files, the OCX has 11. This takes the total over the 128 binary boundary!!
Any thoughts ?
User-defined Type Is Not Defined? But It Is!
I've spent the last day trying to find help with this problem to no avail. I'm using VB6.
I'm making a program that will eventually be able to edit a type of music file that's similar to MIDIs. Don't ask, it's a long story.
My problem started with the problem of storing note info. At first I wanted to use a dynamic array to save memory, but for some reason I keep having trouble with that, and I can address that later once I get this more-important problem out of the way.
I read on MSDN that you could make an array of a user-defined type, so I made the following simple type for notes:
Code:
Public Type orgNote
X As Integer
Y As Integer
Length As Integer
End Type
This is in one of my modules. I'm calling it like so in the declarations section:
Code:
Dim songNotes(0 To ((256 * 16) - 1)) As orgNote
The huge array is my temporary solution to dynamic arrays, and something I'll probably end up asking for help with anyway(The math in the declaration is because I'm too lazy to calculate it. Besides, it's not going to be like that forever). But I keep getting the "User-defined type not defined" error. I've moved it onto the same form as this declaration, and no go. Is there something wrong with my type declaration? I can't for the life with me figure out what's going wrong.
Any help would be greatly appreciated.
[vb5] User Defined Type Not Defined
I'm getting the "user defined type not defined" error on this code in vb5.
In vb6 i have no problems but i want to use the vb5 compiler. what's the problem?
Code:
Option Explicit
Private WithEvents objMessenger As MessengerAPI.Messenger
Private Sub Form_Load()
Set objMessenger = New MessengerAPI.Messenger
End Sub
User Defined Not Type Defined
in the declarations section, i have this:
Code:
Private WithEvents poSendMail As vbSendMail.clsSendMail
but when the program is run, it highlights this and gives the error:
User Defined not Type Defined
any ideas?
thanks
User-defined Type Not Defined (im New)
I dont think the problem I have is database related so i posted here. I am creating a VB Application to access a database. I have the database theory sorted but the very first part of my code seems to have an error. My code so far is below...
Code:
Option Explicit
Dim db As Database
Dim rs As Recordset
Dim ws As Workspace
Dim max As Long
Dim i As Long
Dim errormsg
Dim dbadd As Boolean
Dim dbedit As Boolean
Private Sub Form_Load()
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(App.Path & "xorfLib2.mdb")
Set rs = db.OpenRecordset("Language", dbOpenTable)
langList
End Sub
Private Function langList()
If rs.RecordCount = 0 Then
errormsg = MsgBox("No records fount in xorfLib2.mdb", , "Fatal Error")
Exit Function
End If
rs.MoveLast
rs.MoveFirst
max = rs.RecordCount
rs.MoveFirst
Language.Clear
For i = 1 To max
Language.AddItem rs("Language")
rs.MoveNext
Next i
End Function
It is the second line of the code that is being highlighted and an alert box makes me aware that there is a Compile Error and that a user defined type is not defined. I cannot understand why because the code below works fine (it is a tutorial downloaded from some website)
Here is their code...
Code:
Option Explicit
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''' A Simple Database Example '''
''' Written By Darren Kurn '''
''' 28/09/01 '''
''' xdaz '''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Firstly, For those of you who have never used Databases with your applications
'before, please make a point of going to the project menu, and clicking on
'references. Here you will notice that one of the references is "Microsoft
'DAO Object Library". This is the component which is required to access the
'Database.
'Right,, Lets Start The Example.
'First, we need to dim some variables
'We will start with the DB Variable. This Variable simply tells VB Which Database
'we intend to work from
Dim db As Database
'Next, we have the rs variable. this tells VB which recordset, or table within
'the database that we intend to work from
Dim rs As Recordset
'The ws variable tells VB the workspace. Sorry, but im not entirely sure what this
'actually does, but i do know that it is essential for the project to work
Dim ws As Workspace
'The max variable will eventually hold the number of records in the database
'table, so we can use the variable as a loop control variable
Dim max As Long
'The i variable is just another loop control variable
Dim i As Long
'This variable is used to store any answers from message boxes
Dim errormsg
'these two variables are here so that we know whether we want to add new data to the
'database, or edit existing data
Dim dbadd As Boolean
Dim dbedit As Boolean
'Right, now that we have declared our variables, we can start the actual
'coding of the project
Private Sub Form_Load()
'The first thing that we will need to do when the form loads
'is tell VB which table we are going to work from
Set ws = DBEngine.Workspaces(0)
'Here we set the database. This will tell VB to use the database called
'"Database" which can be found in the same directory as this project.
'Obviously, you do not always have to keep the database in the same directory,
'but i find that it helps!
Set db = ws.OpenDatabase(App.Path & "Database.mdb")
'Here we set the table within the database which we intend to use.
'As we only have one table in our database, this is easy enough.
Set rs = db.OpenRecordset("tbldata", dbOpenTable)
'Next, we will call the List function which will get some of the
'Information out of the database, and place it into the list box
list
End Sub
Private Function list()
'This Function will extract Surnames from the database, and
'Place them into the list box for selection
'If there are no records in the database table, then we cannot extract
'any data, so we have to exit the function. If we do not do this, then
'The program will throw up an error, and crash
If rs.RecordCount = 0 Then
errormsg = MsgBox("No Records Found", , "Error")
'If no records have been found, then it is very likely that the user
'is using the search field, so we will set the text box back to what
'it was before the error came up
If Len(txtSearch.Text) > 0 Then
txtSearch.Text = Mid(txtSearch.Text, 1, Len(txtSearch.Text) - 1)
Else
Exit Function
End If
End If
'Move to the first record in the database
rs.MoveLast
'Move to the last record in the database
rs.MoveFirst
'You're probably wondering why i have just moved to the first, and then
'the last record in the database. Well, I find that Access does not report
'the number of records in the table accurately. I have no idea Why. It's a
'microsoft thing. however, going to the last, and then the first record usually
'helps Access report the accurate number of records
'Next, we need to set variable "max" to the number of records in the database
max = rs.RecordCount
'Now we move back to the first record in the database
rs.MoveFirst
'Now we need to clear our list box, so that we do not have repeating data
lstdata.Clear
'Now we can start a loop, which will in turn extract data from each of the
'records in the database
For i = 1 To max
'For each Entry, we want to put the surname into the list box
'rs("Surname") simply tells VB to get the data from the surname field
lstdata.AddItem rs("surname")
'Then we need to move to the next record in the table
rs.MoveNext
'repeat the loop
Next i
End Function
Private Sub lstdata_Click()
'Once all our surnames are into the list box, we need to control what happens
'when the user click on one of the surnames
'The line below will send an SQL command to the database which tells access
'to create a new theoretical table which only holds the information on
'the selected surname. this works exactly the same way as making a query in the
'database to only show data on a person with a certain surname
Set rs = db.OpenRecordset("Select * from tbldata where surname = '" & Trim(lstdata.list(lstdata.ListIndex)) & "'")
'move to the first record in the table
rs.MoveFirst
'Next, we need to extract the information out of the database, and put
'it in the relevent text boxes
txtForename.Text = rs("forename")
txtSurname.Text = rs("Surname")
txtPhone.Text = rs("phone_no")
'Now we need to enable some of the command buttons so that we can work on the
'data
cmdEdit.Enabled = True
cmdDelete.Enabled = True
End Sub
Private Sub cmdDelete_Click()
'Now we will look at one of the easiest database functions, deletion of data
'First, we will throw up an error message to make sure the user wishes to
'delete the data, because, once you have deleted the data, there is no
'going back
errormsg = MsgBox("Are You Sure You Want To Delete This Record", vbYesNo, "Delete Record")
'if the user has answered yes, we can delete the data
If errormsg = vbYes Then
'Delete the data
rs.Delete
'now we have to set the recordset back to all records in the table, rather than the one
'we just deleted
Set rs = db.OpenRecordset("tbldata", dbOpenTable)
'Then we need to recall the list function to relist all the data, not including the
'record we just deleted
list
'now we need to set the command buttons and text boxes back to their original status
txtSurname.Text = vbNullString
txtSurname.Enabled = False
txtForename.Text = vbNullString
txtForename.Enabled = False
txtPhone.Text = vbNullString
txtPhone.Enabled = False
txtSearch.Text = vbNullString
'then we need to set the command buttons back to their original status
cmdsave.Enabled = False
cmdcancel.Enabled = False
cmdAdd.Enabled = True
Else
'If the user pressed no then we just exit the sub-routine
Exit Sub
End If
End Sub
Private Sub cmdAdd_Click()
'When the add button is pressed, we will first need to clear all the
'text boxes
txtSurname.Text = vbNullString
txtForename.Text = vbNullString
txtPhone.Text = vbNullString
'Now we need to enable the textboxes so that the user can enter the data
txtSurname.Enabled = True
txtForename.Enabled = True
txtPhone.Enabled = True
'We also need to disable all the command buttons, so that the user cannot
'click on one of these and confuse the program
cmdAdd.Enabled = False
cmdDelete.Enabled = False
cmdEdit.Enabled = False
cmdend.Enabled = False
'And enable the save and cancel buttons so that the user can save the
'new data
cmdsave.Enabled = True
cmdcancel.Enabled = True
'Now we set dbadd = true so that VB Knows what we are trying to do
dbadd = True
End Sub
Private Sub cmdsave_Click()
'When the user has finished entering the new data, they will click the
'save button to save the data to the database
'We need to decide at this point whether the user is entering new data
'or editing existing data, already held within the database
'This is what we have used the dbadd and dbedit variables for.
If dbadd = True Then
Call add
ElseIf dbedit = True Then
Call edit
End If
End Sub
Im sorry about posting all of that but i dont want it to take for ever for someone to find the error. I suppose the error could be elsewhere in my code but i am not sure.
Thanks for the help
skripty
http://www.xorf.creators.co.uk
User-defined Type Not Defined
I am working on an assignment for college and i am stuck. Being the novice that i am, i can't get my program to work. I have done most of the code (with help of my teacher) but it keeps on coming up with the same * * * * error all the time "user-defined type not defined". I am really getting stressed out now as my assignment is due in tomorow. I have done all the write-up for the program (despite the program not working at all) but i cannot get the program to run.
I have attached a zip folder containing the program for you to have a look at
Thanks for your help
User-defined Type Not Defined
Hi,
I am trying to compile my project and keep getting a message: user-defined type not defined.
I had to change the name of a dll file to something like
d443dkfw.dll
I registered the dll from the SYSTEM directory, it looks fine and I referenced it from the project - problem is that the program still recognizes the old reference to the original dll name, and will not recognize the new reference.
Could someone tell me what is happening? This is driving me nuts!!
User-defined Type Not Defined
I am making a program for me to learn how to use databases. I am currently using a Microsoft Access database and I get the error, "User-defined Type not defined" when I try to compile my VB program. The code for it is:
Code:
Private Sub cmdexit_Click()
Unload frmenter
End Sub
Private Sub Form_Load()
'Change Location of Form to Fit Screen
frmenter.Width = Screen.Width / 3
frmenter.Height = Screen.Height / 2
frmenter.Top = Screen.Width / 8
frmenter.Left = Screen.Height / 3
'Check to see if any classes exsist
Dim MyConn As ADODB.Connection
Dim MyRecSet As ADODB.Recordset
Dim intClasses As Integer
Dim strAddress As String
Dim strPhone As String
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Program FilesCommon Filesmarks programdbmarks.mdb;"
MyConn.Open
Set MyRecSet = MyConn.Execute("SELECT COUNT(*) as class1 FROM classes")
intClasses = MyRecSet.Fields.Item("class1").Value
MyConn.Close
If intClasses > 0 Then
frmenter.cmdeditclass.Enabled = True
End If
End Sub
It is a program that teachers could use to keep the marks of their students in. That is all I have so far and the error comes from this line
Code:
Dim MyConn As ADODB.Connection
User Defined Type Not Defined?
Hey guys I have a chat prog that when run gives me a user type not defined error.
It highlights this code.
Private WithEvents httCheckVersion As WinHttpRequest
In the block of code
VB Code:
'''Code for shutting down stuffOption ExplicitPrivate WithEvents httCheckVersion As WinHttpRequestPrivate Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _ ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" ( _ ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ ByVal lParam As Long) As Long
Does anyone know how I would define it?
User Defined Type Not Defined?
Hey guys I have this block of code.
VB Code:
Option Explicit'' Code for opening webpages ''Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ByVal hwnd As Long, _ByVal lpOperation As String, _ByVal lpFile As String, _ByVal lpParameters As String, _ByVal lpDirectory As String, _ByVal nShowCmd As Long) As Long'ByVal hwnd As Long, _Private WithEvents http As WinHttpRequestPrivate WithEvents httCheckVersion As WinHttpRequestPrivate WithEvents WinHttpRequest2 As WinHttpRequestPrivate WithEvents http As WinHttpRequestPrivate mContentLength As LongPrivate mProgress As Long
But when I got to run my prog I get the error user defined type not defined and it highlgihts the line of code "WithEvents httCheckVersion As WinHttpRequest"
Can anyone tell me how to define it?
User Defined Type Not Defined?
Hey guys when I go to run a program I get the eroor user definded type not defined. with the code highlighted
VB Code:
Public Sub FillCombo(objComboBox As ListBox, _ oConn As ADODB.Connection, _ strSQL As String, _ strFieldToShow As String, _ Optional strFieldForItemData As String)
How would I define it? Thanks!
User-Defined Type Not Defined
I get that error message with the following code:
vb Code:
Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias _ "GetSaveFileNameA" (pOpenfilename As OpenFilename) As Long
___
Please tell me what is wrong?
User-Defined Type Not Defined
I get that error while trying to follow this tutorial:
http://www.devx.com/vb2themax/Tip/18407
On this line:
Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" _
(ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
- User-defined Type Not Defined.
hi all,
Almost after a year +, m posting a query.. Friends, m trying to use GetSystemTime (API) from Kernel32. but when i try to execute the application, it says User-defined type not defined. i guess, m doing some thing wrong, also i may've forgotten to add some reference..
plz help me.. how to get rid of this error..
thanx in advance
User-defined Type Not Defined ???
Hey guys I keep getting this " user defined type not defined error highlighting the following code.
VB Code:
cStream As New cBinaryFileStream
the entire code is
VB Code:
Option Explicit Private Sub cmdHash_Click() Dim cStream As New cBinaryFileStream cStream.File = txtFileName.Text Dim cCRC32 As New cCRC32 Dim lCRC32 As Long Dim cTimer As New cHiResTimer cTimer.StartTimer lCRC32 = cCRC32.GetFileCrc32(cStream) cTimer.StopTimer txtFileSize.Text = cStream.Length txtCRC32.Text = Hex(lCRC32) txtTime.Text = cTimer.ElapsedTime End Sub Private Sub cmdPick_Click() Dim c As New cCommonDialog Dim sFileName As String If (c.VBGetOpenFileName( _ FileName:=sFileName, _ Owner:=Me.hWnd)) Then txtFileName.Text = sFileName End IfEnd Sub Private Sub Form_Load() txtFileName.Text = App.Path & "" & App.EXEName & ".exe"End Sub
I'm rather new to VB and I don't see the problem, can anyone see it?
Thanks and happy new year
User-defined Type Not Defined
Dim xl As Excel.Application
On this statement I get User-defined type not defined.
Am I missing a reference to use Excel?
|