ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Error after code is run (https://www.excelbanter.com/excel-programming/417126-error-after-code-run.html)

Les

Error after code is run
 
Hi all,

i have code that runs perfectly and does all that i want it do, except at
the end when i want to close it, i get an error message "Run-Time error '424'
Object required".

When i F8 my way through it runs perfectly

it is driving me crazy as i cnnot find the problem !!!

Any help would be welcomed with much happeness.
--
Les

Jim Rech

Error after code is run
 
except at the end when i want to close it

Close what? The workbook? Look at your Workbook Before_Close code in the
ThisWorkbook module if so.

--
Jim
"Les" wrote in message
...
| Hi all,
|
| i have code that runs perfectly and does all that i want it do, except at
| the end when i want to close it, i get an error message "Run-Time error
'424'
| Object required".
|
| When i F8 my way through it runs perfectly
|
| it is driving me crazy as i cnnot find the problem !!!
|
| Any help would be welcomed with much happeness.
| --
| Les


Gary''s Student

Error after code is run
 
On which line of your posted code does the error occur??
--
Gary''s Student - gsnu200805

Les

Error after code is run
 
Hi,

I have just had it again with this code...

vmyComma = InStr(8, Me.txt_PrtNumber.Value, ",")

If vmyComma = 0 Then
Set LookupRange =
Workbooks("Logistics_Cost_TM_Input.xls").Worksheet s("Local
Parts").Range("A2:B65536")

res = Application.VLookup(frm_InputTM.txt_PrtNumber.Valu e,
LookupRange, 2, 0)
If IsError(res) Then
'look as a number:
res =
Application.VLookup(CDbl(frm_InputTM.txt_PrtNumber .Value), _ LookupRange, 2,
0)<==== On this line ???

--
Les


"Jim Rech" wrote:

except at the end when i want to close it


Close what? The workbook? Look at your Workbook Before_Close code in the
ThisWorkbook module if so.

--
Jim
"Les" wrote in message
...
| Hi all,
|
| i have code that runs perfectly and does all that i want it do, except at
| the end when i want to close it, i get an error message "Run-Time error
'424'
| Object required".
|
| When i F8 my way through it runs perfectly
|
| it is driving me crazy as i cnnot find the problem !!!
|
| Any help would be welcomed with much happeness.
| --
| Les



Les

Error after code is run
 
This is the last bit of code that i run...

Sub chkWkbclose()
'
Dim wkb As Integer

On Error Resume Next
Application.IgnoreRemoteRequests = False
Application.DisplayAlerts = False
Application.ScreenUpdating = True
wkb = Application.Workbooks.Count
If wkb <= 2 Then
Application.Quit
Else
ActiveWorkbook.Close
End If

End Sub

--
Les


"Jim Rech" wrote:

except at the end when i want to close it


Close what? The workbook? Look at your Workbook Before_Close code in the
ThisWorkbook module if so.

--
Jim
"Les" wrote in message
...
| Hi all,
|
| i have code that runs perfectly and does all that i want it do, except at
| the end when i want to close it, i get an error message "Run-Time error
'424'
| Object required".
|
| When i F8 my way through it runs perfectly
|
| it is driving me crazy as i cnnot find the problem !!!
|
| Any help would be welcomed with much happeness.
| --
| Les




All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com