Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Fatal Error in Excel with one line in a macro

Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I ran
the macro, I got a fatal error - excel needs to shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks in
advance since I do not want to lose the entire file.

Neal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Fatal Error in Excel with one line in a macro

Neal,

Assuming "xyz" & "abc" are "named ranges", where do they point?

regards,

JohnI

"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I ran
the macro, I got a fatal error - excel needs to shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks in
advance since I do not want to lose the entire file.

Neal



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Fatal Error in Excel with one line in a macro

If Range("xyz") is greater than 1 range, than that can very easily cause a
problem as VBA in this cause is attempting to have the value of the range =
the value of the cell that has been led to by the End method on the Range of
("abc"). If you trying to copy and past of what at the end of the range of
Range("abc") to the range of Range("xyz"), then the following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I ran
the macro, I got a fatal error - excel needs to shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks in
advance since I do not want to lose the entire file.

Neal



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Fatal Error in Excel with one line in a macro

Ronald,

Thanks for the suggestion and clarification. I will
delete the bad code and try this code instead. I was not
sure if it was the code or if my computer is going bad
(i.e. code written on a bad sector), but I do not know
enough about computers to make that judgement.

Neal


-----Original Message-----
If Range("xyz") is greater than 1 range, than that can

very easily cause a
problem as VBA in this cause is attempting to have the

value of the range =
the value of the cell that has been led to by the End

method on the Range of
("abc"). If you trying to copy and past of what at the

end of the range of
Range("abc") to the range of Range("xyz"), then the

following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I

ran
the macro, I got a fatal error - excel needs to

shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks

in
advance since I do not want to lose the entire file.

Neal



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Fatal Error in Excel with one line in a macro

Ronald,

Here is the actual code. I tried the code on another
spreadsheet and it works. Something else is messing up
the original file.

Range("EndDate") = Range("MainDate").End(xlDown)

This works in a different file. EndDate is in one sheet
and MainDate is in another sheet on the same workbook.

Neal


-----Original Message-----
If Range("xyz") is greater than 1 range, than that can

very easily cause a
problem as VBA in this cause is attempting to have the

value of the range =
the value of the cell that has been led to by the End

method on the Range of
("abc"). If you trying to copy and past of what at the

end of the range of
Range("abc") to the range of Range("xyz"), then the

following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I

ran
the macro, I got a fatal error - excel needs to

shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks

in
advance since I do not want to lose the entire file.

Neal



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Fatal Error in Excel with one line in a macro

Okay, if you are after the value as I assume you are and both ranges are 1
cell ranges, you could try the following:

Range("EndDate").Value = Range("MainDate").End(xlDown).Value

If you are trying to refer to a workbook that is different from the workbook
that is currently active, you may have problems. Another thing, are the
range names workbook level or worksheet level? If they are worksheet level,
it is best that you prequalify your range objects with the proper worksheet
object, and the same can hold true with prequalifying your worksheet objects
with the proper workbook object.

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal" wrote in message
...
Ronald,

Here is the actual code. I tried the code on another
spreadsheet and it works. Something else is messing up
the original file.

Range("EndDate") = Range("MainDate").End(xlDown)

This works in a different file. EndDate is in one sheet
and MainDate is in another sheet on the same workbook.

Neal


-----Original Message-----
If Range("xyz") is greater than 1 range, than that can

very easily cause a
problem as VBA in this cause is attempting to have the

value of the range =
the value of the cell that has been led to by the End

method on the Range of
("abc"). If you trying to copy and past of what at the

end of the range of
Range("abc") to the range of Range("xyz"), then the

following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I

ran
the macro, I got a fatal error - excel needs to

shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks

in
advance since I do not want to lose the entire file.

Neal



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Fatal Error in Excel with one line in a macro

Ronald,

I forgot about using value. Maybe that is why the first
file is bombing out. Everything is in one workbook, but I
think I will reference it with the worksheets. My only
question is why would this cause a fatal Excel error and
not just a VBA error?


-----Original Message-----
Okay, if you are after the value as I assume you are and

both ranges are 1
cell ranges, you could try the following:

Range("EndDate").Value = Range("MainDate").End

(xlDown).Value

If you are trying to refer to a workbook that is

different from the workbook
that is currently active, you may have problems. Another

thing, are the
range names workbook level or worksheet level? If they

are worksheet level,
it is best that you prequalify your range objects with

the proper worksheet
object, and the same can hold true with prequalifying

your worksheet objects
with the proper workbook object.

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal" wrote in message
...
Ronald,

Here is the actual code. I tried the code on another
spreadsheet and it works. Something else is messing up
the original file.

Range("EndDate") = Range("MainDate").End(xlDown)

This works in a different file. EndDate is in one sheet
and MainDate is in another sheet on the same workbook.

Neal


-----Original Message-----
If Range("xyz") is greater than 1 range, than that can

very easily cause a
problem as VBA in this cause is attempting to have the

value of the range =
the value of the cell that has been led to by the End

method on the Range of
("abc"). If you trying to copy and past of what at the

end of the range of
Range("abc") to the range of Range("xyz"), then the

following would suffice

Range("xyz").End(xlDown).Copy
ActiveWorksheet.Paste(Range("xyz"))

--
Ronald R. Dodge, Jr.
Production Statistician
Master MOUS 2000
"Neal Steiner" wrote in message
...
Dear Experts,

I have a file in Excel 97 that I have been building

for
some months. Yesterday, I added just one line of

code
that is Range("xyz")=range("abc").end(xldown). When

I
ran
the macro, I got a fatal error - excel needs to

shutdown.
When I made this line a comment line, everything

worked.
When I tried to delete the line, excel got hung up.

Any
suggestions on how to fix this or delete this?

Thanks
in
advance since I do not want to lose the entire file.

Neal


.



.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Fatal Error in Excel with one line in a macro

I don't think I've seen excel die with a fatal error on a line like this. (My
code could stop processing, but excel itself keeps running.)

But I don't have a guess either.

I would try Rob Bovey's code cleaner (available from: http://www.appspro.com)
to see if that cleaned up the problem.



Neal Steiner wrote:

Dear Experts,

I have a file in Excel 97 that I have been building for
some months. Yesterday, I added just one line of code
that is Range("xyz")=range("abc").end(xldown). When I ran
the macro, I got a fatal error - excel needs to shutdown.
When I made this line a comment line, everything worked.
When I tried to delete the line, excel got hung up. Any
suggestions on how to fix this or delete this? Thanks in
advance since I do not want to lose the entire file.

Neal


--

Dave Peterson

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
Fatal error unrecoverable excel 2002 NealMed Excel Discussion (Misc queries) 1 May 15th 07 12:14 AM
Fatal Error!! Barry Jive Excel Discussion (Misc queries) 1 June 28th 05 06:09 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Excel is saying that it is not installed and that a fatal error h. Katie Isobel Excel Discussion (Misc queries) 1 April 3rd 05 09:40 AM
Fatal Error in creating worksheet Joe Adams Excel Programming 1 September 8th 03 06:59 PM


All times are GMT +1. The time now is 05:32 AM.

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

About Us

"It's about Microsoft Excel"