ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Run time error-subscript out of range (https://www.excelbanter.com/excel-programming/356678-run-time-error-subscript-out-range.html)

ldd

Run time error-subscript out of range
 

I have developed an error report with a userform that when filled out
populates the error report, e-mails me a copy, and fills the necessary
information into another workbook. It seems to be working fine on all
the workstations that we have here at work with the exception of 3
workstations. When it is run on those three I get a "subscript out of
range" on those stations. The code runs up to the line where it is
supposed to find the empty row in the errordata file. The code stops
and returns an error at the last filled cell instead of looping to the
first empty cell. I have tried looking at the various settings and have
seen nothing out of the usual on these workstations. I will post the
code where it stops. I would appreciate any help. Thanks in advance.

*workbooks.open (\"\\file path\errordata.xls\")
workbooks(\"errordata\").sheets(\"data\").activate-this is the line
highlighted during the debug.
activesheet.range(\"a2\").select
' this selects the first empty row
do
if isempty(activecell) = false then
activecell.offset(1, 0).select
end if
loop until isempty(activecell) = true
'this copies the information into the error report data file
activecell.value = workbooks(\"error report\").sheets(\"error
report\").range(\"customer\").value
activecell.offset(0, 1) = workbooks(\"error
report\").sheets(\"error report\").range(\"partnumber\").value
activecell.offset(0, 2) = workbooks(\"error
report\").sheets(\"error report\").range(\"date\").value
activecell.offset(0, 3) = workbooks(\"error
report\").sheets(\"error report\").range(\"ordernumber\").value
activecell.offset(0, 5) = workbooks(\"error
report\").sheets(\"error report\").range(\"errortype\").value
activecell.offset(0, 6) = workbooks(\"error
report\").sheets(\"error report\").range(\"name\").value*[/b][/size]


--
ldd
------------------------------------------------------------------------
ldd's Profile: http://www.excelforum.com/member.php...o&userid=19157
View this thread: http://www.excelforum.com/showthread...hreadid=524876



All times are GMT +1. The time now is 03:14 AM.

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