Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2003 Runtime error 40036

My company still uses the older MS Office 2003 everywhere, so I'm
stuck working with that. However, I seem to have come across a runtime
error which started coming up just today. Specifically, Runtime Error
40036 (Application-defined or object-defined error).
It seems to come up every time the compiler reaches a Worksheets
container in my code. So far, it's prevented me from using the lines:
Worksheets("Sheet1").Activate
or
Worksheets("Sheet1").Range("A1").Value = 4

or anything related to the container. Till yesterday, all of my code
had been running without any hitches, but starting from today morning
this error came up everywhere this container was used.
I've looked at other forums for help on this, and in each place it
appears this error seems to have come up for a random command or
object, even if the code had functioned properly before. Also the
solutions, where given, were always workarounds specific to that line
of code, and nothing that directly solved the problem, except for
reinstalling the entire MS Office, which I can't do due to Admin
rights. Any help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Excel 2003 Runtime error 40036

After serious thinking Anoop V wrote :
My company still uses the older MS Office 2003 everywhere, so I'm
stuck working with that. However, I seem to have come across a runtime
error which started coming up just today. Specifically, Runtime Error
40036 (Application-defined or object-defined error).
It seems to come up every time the compiler reaches a Worksheets
container in my code. So far, it's prevented me from using the lines:
Worksheets("Sheet1").Activate
or
Worksheets("Sheet1").Range("A1").Value = 4

or anything related to the container. Till yesterday, all of my code
had been running without any hitches, but starting from today morning
this error came up everywhere this container was used.
I've looked at other forums for help on this, and in each place it
appears this error seems to have come up for a random command or
object, even if the code had functioned properly before. Also the
solutions, where given, were always workarounds specific to that line
of code, and nothing that directly solved the problem, except for
reinstalling the entire MS Office, which I can't do due to Admin
rights. Any help?


Is there a sheet named "Sheet1" in the workbook? OR has it been
renamed, maybe?

Is the code in the same workbook that 'Sheet1' is in? If so...

ThisWorkbook.Sheets("Sheet1").Range("A1").Value = 4

...whereby it's not necessary to activate the sheet to assign a value.


Otherwise, you could ref the CodeName property in cases where sheet
tabs may be renamed by other users...

ThisWorkbook.Sheets(Get_SheetTabName(ThisWorkbook, _
"Sheet1")).Range("A1").Value = 4

Function Get_SheetTabName(Wkb As Workbook, CodeName As String) As
String
Dim Wks As Worksheet
For Each Wks In Wkb.Worksheets
If Wks.CodeName = CodeName Then _
Get_SheetTabName = Wks.name: Exit Function
Next
End Function

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Excel 2003 Runtime error 40036

On Wednesday, June 13, 2012 2:14:02 AM UTC-4, Anoop V wrote:
My company still uses the older MS Office 2003 everywhere, so I'm
stuck working with that. However, I seem to have come across a runtime
error which started coming up just today. Specifically, Runtime Error
40036 (Application-defined or object-defined error).
It seems to come up every time the compiler reaches a Worksheets
container in my code. So far, it's prevented me from using the lines:
Worksheets("Sheet1").Activate
or
Worksheets("Sheet1").Range("A1").Value = 4

or anything related to the container. Till yesterday, all of my code
had been running without any hitches, but starting from today morning
this error came up everywhere this container was used.
I've looked at other forums for help on this, and in each place it
appears this error seems to have come up for a random command or
object, even if the code had functioned properly before. Also the
solutions, where given, were always workarounds specific to that line
of code, and nothing that directly solved the problem, except for
reinstalling the entire MS Office, which I can't do due to Admin
rights. Any help?


Another possibility is that the sheet has become protected.

Robert Flanagan
Add-ins.com LLC
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 Runtime error 40036

On Thursday, June 14, 2012 10:47:13 AM UTC+8, Bob Flanagan wrote:
On Wednesday, June 13, 2012 2:14:02 AM UTC-4, Anoop V wrote:
My company still uses the older MS Office 2003 everywhere, so I'm
stuck working with that. However, I seem to have come across a runtime
error which started coming up just today. Specifically, Runtime Error
40036 (Application-defined or object-defined error).
It seems to come up every time the compiler reaches a Worksheets
container in my code. So far, it's prevented me from using the lines:
Worksheets("Sheet1").Activate
or
Worksheets("Sheet1").Range("A1").Value = 4

or anything related to the container. Till yesterday, all of my code
had been running without any hitches, but starting from today morning
this error came up everywhere this container was used.
I've looked at other forums for help on this, and in each place it
appears this error seems to have come up for a random command or
object, even if the code had functioned properly before. Also the
solutions, where given, were always workarounds specific to that line
of code, and nothing that directly solved the problem, except for
reinstalling the entire MS Office, which I can't do due to Admin
rights. Any help?


Another possibility is that the sheet has become protected.

Robert Flanagan
Add-ins.com LLC
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


No, the workbook was completely unchanged. It was working on Monday, and then on Tuesday it started causing the runtime error. There was no renaming of sheets or change in protection.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Excel 2003 Runtime error 40036

Did you even try my suggestions? It uses 'fully qualified' refs and so
should not raise an error!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Excel 2003 Runtime error 40036

On Thursday, June 14, 2012 1:06:18 PM UTC+8, GS wrote:
Did you even try my suggestions? It uses 'fully qualified' refs and so
should not raise an error!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



@Garry : Thanks for the suggestions, and I did try it out, but it's no joy. It's still giving the same error.
What I meant earlier was that it appears as if the Worksheets / Sheets collection isn't working in the first place. The problem definitely isn't with anyone modifying the contents of the file, as I'm the only one who has access to it. My own opinion is that some reference to the functions or properties under the Worksheets / Sheets is now missing or deleted in some way.

To explain it further, I can't even access any sheets using the sheet index numbers. Even the following line causes the same error
Worksheets(1).Activate
or
Sheets(1).Activate

for any index number.
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Excel 2003 Runtime error 40036

brought next idea :
On Thursday, June 14, 2012 1:06:18 PM UTC+8, GS wrote:
Did you even try my suggestions? It uses 'fully qualified' refs and so
should not raise an error!

--
Garry

Free usenet access at
http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



@Garry : Thanks for the suggestions, and I did try it out, but it's no joy.
It's still giving the same error. What I meant earlier was that it appears as
if the Worksheets / Sheets collection isn't working in the first place. The
problem definitely isn't with anyone modifying the contents of the file, as
I'm the only one who has access to it. My own opinion is that some reference
to the functions or properties under the Worksheets / Sheets is now missing
or deleted in some way.

To explain it further, I can't even access any sheets using the sheet index
numbers. Even the following line causes the same error Worksheets(1).Activate
or
Sheets(1).Activate

for any index number.


It sounds like you have a 'corrupt' file and so you might want to
rebuild the project starting with a new file and move components into
it one by one, testing to see if/when the issue appears as you go.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
Excel 2007 vs Excel 2003 = Runtime Error 438 Coleman1 Excel Programming 4 July 16th 09 06:07 PM
Excel 2003 Runtime Error M4Help Setting up and Configuration of Excel 0 March 13th 08 09:00 PM
Excel 2000 - Excel 2003 now throws 'runtime error' Ralph L Excel Programming 3 April 10th 06 05:20 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Excel 2003 Help Runtime Error Weezay Excel Discussion (Misc queries) 1 January 27th 05 06:57 PM


All times are GMT +1. The time now is 10:01 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"