Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Project is locked... 1

Status
Not open for further replies.

danomaniac

Programmer
Jan 16, 2002
266
0
0
US
I'm confused...I've written an Excel 2000 spreadsheet with lots of VBA code. I locked the project for viewing, it prompted me for a password, I put one in...viola! Worked fine. I unlocked it and re-locked it a few times just to be sure. I copied the spreadsheet to a floppy and then copied it onto another computer. I tried to unlock the code, and it just says, "Project is locked." Duh. No password prompt. Any ideas? I've still got the original saved without the lock, so I haven't lost anything. I just can't figure it out.


 
Hi danomaniac,
Just a random idea - check the file properties of the xls file that's giving you trouble in My Computer or Windows Explorer. See if it's marked Read-only. If it is, uncheck that and try opening and editing the file again.

Another random idea - when you copied the file to the floppy, was it currently open or had you closed it first? If it was open..

Could be totally off-base, but there's no harm in checking :) Katie
Hi! I'm currently studying the COM+ programming model. Hopefully YOU'RE having fun, which would make one of us..
 
Hi,

Could it be that you wrote it in, say Excel 2000, and tried to open it in another version, say Excel 97?

Hmmmm? ;-) Skip,
metzgsk@voughtaircraft.com
 
Yes. I wrote it in excel 2000 and tried to open it in excel 97. That must be it because I can unlock the code on my computer at work, too, which is also Excel 2000 (not that I do personal stuff at work). Let me share what I've done...
My wife is a teacher and I've written a gradebook spreadsheet for her and her colleagues to use. Everything worked great at home. I took it to the school to show it off and I get errors during code execution. Most of the errors appear to be when I use the protect or unprotect method via code. I've gotten it to work by remming out all the protect and unprotect lines and unprotecting the effected sheets before running the code. I hate to leave it with unprotected sheets though. I've also gotten a few illegal operation errors when trying to print- don't know if that's because of Windows, or my code, or the 97 vs 2000 thing. It's difficult to troubleshoot because I don't have ready access to Excel 97.
If it is truly just a 97/2000 issue, can I convert it to 97? Is there anyone with excel 97 who would like to take a look at it and maybe debug it so it would run on 97?
Thanks very much.
 
I have run into this problem before.

Here's what I would suggest.

Export all of your VBA modules from the 2000 version.

Import them into your 97 version and compile.

You will have to use whatever Project Protection there is in the 97 version. In my case, the user upgraded to 2000, so I never had to fully address this issue.

Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
One more thing...It's about 1 Meg in size. Is there any way to reduce the size? I have 10 sheets and some code and a few small forms. What is it that takes up space? Is it the cell formatting (colors, borders etc.)? Do the entire 65000 + rows count in the spreadsheet size or is it just used cells? I've thought about making all the sheets on one sheet, i.e. start sheet 2 say, 100 rows down, sheet 3 200 rows down etc and have a button on the sheet to take you directly to the start of whichever you chose. That way it would all fit on one sheet. It all depends on how the size is calculated.

Thoughts?
 
Excel does not relinquish space very well. Actually, to get a lean application, once your coding and testing has been completed, it is a good idea to do exactly what I recommended --

Export/Import your modules.

I'll bet that you'll see a significant decrease in the size of the application. If you have alot of code, you might with to think about removing all the indent/comments in your Run version, keeping another copy that has formatting for each maintenance.

If you have alot of sheet functions, make sure that your spreadsheet data is mostly narrow (in columns) and long (in rows). Excel processes quicker with long thin tables rather than short fat tables.

Good luck :) Skip,
metzgsk@voughtaircraft.com
 
Thanks for the advice, I got a copy of office 97 and will install it this weekend and play with it.
 
Hello, this is the first time I've used the forum - so be gentle with me !

I've having the same "Project is locked" message without any prompt for a password on one of my workbooks. I locked the project for viewing, it prompted me for a password, I put one in and it worked fine...but no more.... Unfortunately I haven't got the original saved without the lock, so any help would be very much appreciated. No version confusion here though ! Created in Excel 97, trying to re-open in Excel 97. Any ideas ?
 
LeighAnne,
Oooh, don't know about that one. Reaching here, are you trying to open it on the same machine it was created on? If not, could be a release date thing. The only thing that should cause that is if you attempt to view the project on an older version than it was created on. Can you open it on in Excel 2000? (If you don't have access to 2K, you could email it to me and I'd be happy to try.)

Dan

danomaniac@hotmail.com
(you probably could have guessed)
 
did you mark the workbook as 'shared workbook'?
Go to Tools, Share workbook,..... and chage it.
Good luck
[2thumbsup]
 
Mahathma,

No, it wasn't a shared workbook, I ended up having to use an older version of the workbook and update it.

Leigh-anne
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top