Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Help! I'm completely lost on this one!!
I have an application that I've built in Excel and sent to a friend t test in his business but although it runs perfectly on my deskto (office 2000) and laptop (Office 2002) it won't run on ANY of his PCs. The error message that comes up apparently says Run-time error "1004" Application-undefined or Object-undefined The error appears to stop on the line "ActiveSheet.Protec Password:=Sheets("sheet2").Range("w29").Value" in the following code: ------------------------------------------------------------- Application.EnableCancelKey = xlDisabled Calculate ActiveSheet.Protect Password:=Sheets("sheet2").Range("w29").Value Sheets("home").Visible = True Sheets("Home").Select Application.ScreenUpdating = False etc etc -------------------------------------------------------------- ......but there are a number of lines like this which re-lock sheet prior to going to a different worksheet using a randomly generate number in cell W29 My friend has tried it on Office 2000 and Office 2003 on multiple PC and always gets the same message, which I just can't recreate in m office....and sending him a copy that works on mine....still won't wor on his. In Visual Basic Editor I can see that I have the following referece checked, and as far as I can ascertain over the 'phone my friend ha similar checked: Visual Basic For Applications Microsoft Excel 9.0 Object Library OLE Automation Microsoft Office 9.0 Object Library Microsoft Forms 2.0 Object Library I'm concerned that errors like this make Excel unreliable in running o other PCs even when they are running the same apps as me. Any help would be gratefully received. Many thanks, Chris -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel's protection got a little more stringent in xl2002.
If you unprotect it with the correct password first, then it may work ok for you. "Big Chris <" wrote: Help! I'm completely lost on this one!! I have an application that I've built in Excel and sent to a friend to test in his business but although it runs perfectly on my desktop (office 2000) and laptop (Office 2002) it won't run on ANY of his PCs. The error message that comes up apparently says Run-time error "1004" Application-undefined or Object-undefined The error appears to stop on the line "ActiveSheet.Protect Password:=Sheets("sheet2").Range("w29").Value" in the following code: ------------------------------------------------------------- Application.EnableCancelKey = xlDisabled Calculate ActiveSheet.Protect Password:=Sheets("sheet2").Range("w29").Value Sheets("home").Visible = True Sheets("Home").Select Application.ScreenUpdating = False etc etc -------------------------------------------------------------- .....but there are a number of lines like this which re-lock sheets prior to going to a different worksheet using a randomly generated number in cell W29 My friend has tried it on Office 2000 and Office 2003 on multiple PCs and always gets the same message, which I just can't recreate in my office....and sending him a copy that works on mine....still won't work on his. In Visual Basic Editor I can see that I have the following refereces checked, and as far as I can ascertain over the 'phone my friend has similar checked: Visual Basic For Applications Microsoft Excel 9.0 Object Library OLE Automation Microsoft Office 9.0 Object Library Microsoft Forms 2.0 Object Library I'm concerned that errors like this make Excel unreliable in running on other PCs even when they are running the same apps as me. Any help would be gratefully received. Many thanks, Chris. --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave,
Thanks for looking. I'm not sure what you mean though. This code is protecting the shee with the contents of W29, not unprotecting it. Also, this is happening on an Office 2000 PC as well as Office 2003, s it's happening on a pre and a post 2002. Because it works OK on both my O2000 and O2003 I kinda wonder if it's setting somewhere. Some macros in the same project work, so marcros ar enabled. Any further thoughts please.....anyone? Many thanks, Chris -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is the worksheet protected when you start?
"Big Chris <" wrote: Dave, Thanks for looking. I'm not sure what you mean though. This code is protecting the sheet with the contents of W29, not unprotecting it. Also, this is happening on an Office 2000 PC as well as Office 2003, so it's happening on a pre and a post 2002. Because it works OK on both my O2000 and O2003 I kinda wonder if it's a setting somewhere. Some macros in the same project work, so marcros are enabled. Any further thoughts please.....anyone? Many thanks, Chris. --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dave,
Yes it is protected, and this macro is there to relock a sheet which i not locked by inserting the randomly generated password from Cell W29. Usually - on my O2000 desktop and O2002 laptop, it flows through an ignores this line if the sheet is already locked and I have n problems. Why should it work on some Pcs but not on others? Any further thoughts you have would be much appreciated. Regards, Chri -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm confused.
You say the worksheet is protect, then say it's to relock a sheet which is not locked. I've found xl2002 won't change the password of a protected sheet just by using worksheets("sheet1").protect password:="newpassword" I have to unprotect it first with the correct password. I believe this was changed from xl2k's behavior. (But that's from memory--not from testing!) "Big Chris <" wrote: Dave, Yes it is protected, and this macro is there to relock a sheet which is not locked by inserting the randomly generated password from Cell W29. Usually - on my O2000 desktop and O2002 laptop, it flows through and ignores this line if the sheet is already locked and I have no problems. Why should it work on some Pcs but not on others? Any further thoughts you have would be much appreciated. Regards, Chris --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro will not work - Please help | Excel Discussion (Misc queries) | |||
Macro to update a column in a work based on another work sheet | New Users to Excel | |||
Macro works Macro does not work | Excel Discussion (Misc queries) | |||
how to get a macro to work | Excel Discussion (Misc queries) | |||
Why does the macro not work? | Excel Worksheet Functions |