Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default run time error 1004 only on web run

trying to utilize a workbook on the web works fine on the computer, once i
test it in the browser i get a 1004 run time error
Dim NewRow As Integer
on the following line
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

If Len(MyForm.fregion.Value) = 0 Then
MsgBox "The Region field can not be left Blank!", vbOKOnly, "IPA Training -
Input Form"
MyForm.fregion.SetFocus
--
Bucky F
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default run time error 1004 only on web run

The only way the line below will give a 1004 error if the code cannot find
the worksheet "Input Sheet". It doesn't matter how the name of the sheet is
capatilized. The problem is probably due to the fact that you have more than
one workbook opend and the code is looking at the wrong workbook.

Make sure you give a name to each workbook. the workbook the code is
running you can use ThisWorkBook. Name each workbook as you open the
workbooks and then make sure you include the workbook name in every
reference. do the same type thing with each worksheet.

set newbk = workbooks.open filename:= "abc.xls"
with newbk
.Sheets("Sheet1").Range("A1").copy _
.Sheets("Sheet1").Range("B2")
end with


NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

"willfeld" wrote:

trying to utilize a workbook on the web works fine on the computer, once i
test it in the browser i get a 1004 run time error
Dim NewRow As Integer
on the following line
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

If Len(MyForm.fregion.Value) = 0 Then
MsgBox "The Region field can not be left Blank!", vbOKOnly, "IPA Training -
Input Form"
MyForm.fregion.SetFocus
--
Bucky F

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default run time error 1004 only on web run

joel, there is only 1 workbook, this happens on a click command button off a
user form when i go to enter the data to a table sheet. it fails after the
button push at that line. only in the browser. the workbook has 5 sheets.
The error says runtime 1004_ global ?
--
Bucky F


"Joel" wrote:

The only way the line below will give a 1004 error if the code cannot find
the worksheet "Input Sheet". It doesn't matter how the name of the sheet is
capatilized. The problem is probably due to the fact that you have more than
one workbook opend and the code is looking at the wrong workbook.

Make sure you give a name to each workbook. the workbook the code is
running you can use ThisWorkBook. Name each workbook as you open the
workbooks and then make sure you include the workbook name in every
reference. do the same type thing with each worksheet.

set newbk = workbooks.open filename:= "abc.xls"
with newbk
.Sheets("Sheet1").Range("A1").copy _
.Sheets("Sheet1").Range("B2")
end with


NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

"willfeld" wrote:

trying to utilize a workbook on the web works fine on the computer, once i
test it in the browser i get a 1004 run time error
Dim NewRow As Integer
on the following line
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

If Len(MyForm.fregion.Value) = 0 Then
MsgBox "The Region field can not be left Blank!", vbOKOnly, "IPA Training -
Input Form"
MyForm.fregion.SetFocus
--
Bucky F

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default run time error 1004 only on web run

I suspect there are some event macros that are running in the workbook that
you are not aware of. Go to the VBA editor and check the Project window.
Check every Sheet and ThisWorkbook looking for hidden macros. Double click
on each sheet checking for code.

I suspect one of these macro may be the cause of the problem. The I think
another workbook is being selected and causing the problem. I simple
solution may be to make th e follwing change

from
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1
to
NewRow = Thisworkbook.Worksheets("INPUT SHEET").Range("B3").Value + 1



"willfeld" wrote:

joel, there is only 1 workbook, this happens on a click command button off a
user form when i go to enter the data to a table sheet. it fails after the
button push at that line. only in the browser. the workbook has 5 sheets.
The error says runtime 1004_ global ?
--
Bucky F


"Joel" wrote:

The only way the line below will give a 1004 error if the code cannot find
the worksheet "Input Sheet". It doesn't matter how the name of the sheet is
capatilized. The problem is probably due to the fact that you have more than
one workbook opend and the code is looking at the wrong workbook.

Make sure you give a name to each workbook. the workbook the code is
running you can use ThisWorkBook. Name each workbook as you open the
workbooks and then make sure you include the workbook name in every
reference. do the same type thing with each worksheet.

set newbk = workbooks.open filename:= "abc.xls"
with newbk
.Sheets("Sheet1").Range("A1").copy _
.Sheets("Sheet1").Range("B2")
end with


NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

"willfeld" wrote:

trying to utilize a workbook on the web works fine on the computer, once i
test it in the browser i get a 1004 run time error
Dim NewRow As Integer
on the following line
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

If Len(MyForm.fregion.Value) = 0 Then
MsgBox "The Region field can not be left Blank!", vbOKOnly, "IPA Training -
Input Form"
MyForm.fregion.SetFocus
--
Bucky F

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default run time error 1004 only on web run

Thank you soooo much that last idea worked. there weren't any other macros
or hidden code anywhere but I had to add Workbooks to all of the lines that
said worksheet. then it ran fine on the web.

thanks again, that was driving me nuts.
--
Bucky F


"Joel" wrote:

I suspect there are some event macros that are running in the workbook that
you are not aware of. Go to the VBA editor and check the Project window.
Check every Sheet and ThisWorkbook looking for hidden macros. Double click
on each sheet checking for code.

I suspect one of these macro may be the cause of the problem. The I think
another workbook is being selected and causing the problem. I simple
solution may be to make th e follwing change

from
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1
to
NewRow = Thisworkbook.Worksheets("INPUT SHEET").Range("B3").Value + 1



"willfeld" wrote:

joel, there is only 1 workbook, this happens on a click command button off a
user form when i go to enter the data to a table sheet. it fails after the
button push at that line. only in the browser. the workbook has 5 sheets.
The error says runtime 1004_ global ?
--
Bucky F


"Joel" wrote:

The only way the line below will give a 1004 error if the code cannot find
the worksheet "Input Sheet". It doesn't matter how the name of the sheet is
capatilized. The problem is probably due to the fact that you have more than
one workbook opend and the code is looking at the wrong workbook.

Make sure you give a name to each workbook. the workbook the code is
running you can use ThisWorkBook. Name each workbook as you open the
workbooks and then make sure you include the workbook name in every
reference. do the same type thing with each worksheet.

set newbk = workbooks.open filename:= "abc.xls"
with newbk
.Sheets("Sheet1").Range("A1").copy _
.Sheets("Sheet1").Range("B2")
end with


NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

"willfeld" wrote:

trying to utilize a workbook on the web works fine on the computer, once i
test it in the browser i get a 1004 run time error
Dim NewRow As Integer
on the following line
NewRow = Worksheets("INPUT SHEET").Range("B3").Value + 1

If Len(MyForm.fregion.Value) = 0 Then
MsgBox "The Region field can not be left Blank!", vbOKOnly, "IPA Training -
Input Form"
MyForm.fregion.SetFocus
--
Bucky F



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
run time error 1004 general odbc error excel 2003 vba Mentos Excel Programming 5 January 24th 11 02:56 PM
Run Time Error 1004: Application or Object Defined Error BEEJAY Excel Programming 4 October 18th 06 04:19 PM
Run Time 1004 Error: Application or Object Difine Error BEEJAY Excel Programming 0 October 17th 06 10:45 PM
run-time error '1004': Application-defined or object-deifined error [email protected] Excel Programming 5 August 10th 05 09:39 PM
Run time error 1004 General ODCB Error Kevin Excel Programming 3 February 26th 05 12:51 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"