Log in

View Full Version : iam getting Vba erro1004



bhandari
12-31-2017, 11:23 AM
Option Explicit
Private Trial As Long

[CODE]
Private Sub cmdCheck_Click()
'Declare the variables
Dim AddData As Range
Dim user As Variant
Dim Code As Variant
Dim result As Integer
Dim TitleStr As String
Dim Current As Range
Dim PName As Variant
Dim msg As VbMsgBoxResult

'Variables
user = Me.TxtUser.Value
Code = Me.TxtPass.Value
TitleStr = "Password check"
result = 0
Set Current = Sheet6.Range("K2")
'Error handler
On Error GoTo errHandler:
'Destination location for login storage
Set AddData = Sheet6.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0)
'Check the login and passcode for the administrator
If user = "Hardy Cross" And Code = 8118425 Then
MsgBox "Welcome Back:

Excel Fox
01-04-2018, 09:51 PM
Hi bhandari

You haven't mentioned which line you get the error.

Excel Fox
01-13-2018, 07:17 AM
Cross-posted

https://www.excelforum.com/excel-programming-vba-macros/1213819-iam-getting-vba-error1004.html
https://www.mrexcel.com/forum/excel-questions/1036984-issue-macro.html

lorein0688
02-15-2018, 05:21 PM
Try the given solution to fix solution to fix the error VBA error1004

1. Right click on the start menu
2. Then select the Explore option
3. Then open the following directory – C:\Program Files\MSOffice\Office\XLSTART
4. Here you need to delete “GWXL97.XLA” file
5. And open the excel after closing the explorer

repairmsexcel.com