Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
hello all,
is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
Hi,
I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
I should have added in hiding the sheets you make them very hidden so if the
workbook is opened with macros disabled the user can't unhide them without access to your project which you have protected. Private Sub Workbook_BeforeClose(Cancel As Boolean) For x = 2 To Worksheets.Count Sheets(x).Visible = xlVeryHidden Next End Sub Mike "Mike H" wrote: Hi, I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
Hi Mike, You wrote "Substitute xxxx for your computername and note
it's case sensitive." Did you mean "Substitute your computername for "xxxx" and note it's case sensitive"? "Mike H" wrote: Hi, I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
That's excatly what I meant, thanks for the correction:)
"JLGWhiz" wrote: Hi Mike, You wrote "Substitute xxxx for your computername and note it's case sensitive." Did you mean "Substitute your computername for "xxxx" and note it's case sensitive"? "Mike H" wrote: Hi, I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
thank you so much Mike & JLGWhite........
"Mike H" wrote: That's excatly what I meant, thanks for the correction:) "JLGWhiz" wrote: Hi Mike, You wrote "Substitute xxxx for your computername and note it's case sensitive." Did you mean "Substitute your computername for "xxxx" and note it's case sensitive"? "Mike H" wrote: Hi, I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code or Even ?
Glad I could help
"Tufail" wrote: thank you so much Mike & JLGWhite........ "Mike H" wrote: That's excatly what I meant, thanks for the correction:) "JLGWhiz" wrote: Hi Mike, You wrote "Substitute xxxx for your computername and note it's case sensitive." Did you mean "Substitute your computername for "xxxx" and note it's case sensitive"? "Mike H" wrote: Hi, I doub't there's any foolproff way but you could do this. On closing your workbook hide all sheets except one with no information in it and have this in the workbook open event. Substitute xxxx for your computername and note it's case sensitive. Private Sub Workbook_Open() If Environ("Computername") < "xxxxx" Then ActiveWorkbook.Close savechanges:=False Else For Each Worksheet In ThisWorkbook.Worksheets Worksheet.Visible = True Next End If End Sub Mike "Tufail" wrote: hello all, is there any code or event that doesn't allow to open my work book in any other computer ? Yes i am protected my WB with PW. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
split post code (zip code) out of cell that includes full address | Excel Discussion (Misc queries) | |||
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does | Excel Programming | |||
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. | Excel Programming | |||
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... | Excel Programming | |||
Excel code convert to Access code - Concat & eliminate duplicates | Excel Programming |