Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activating problem
I might have too complicated idea to secure my workbooks but.......
I used to have security macro in each of my workbooks which tested harddrives serialnumber. Chancing and adding a computer makes it too hard work to edit all of those workbooks to add new serials. So I made an external sec.xls file which do the trick. 1. When a calculation workbook (auto-open macro) is opened it opens sec.xls in the very same folder where it was started and adds a workbooks name inside sec.xls to A6 as string, which calls it. So it can come back to original workbook. 2. According to sec.xls (auto-open macro) calculation it should compare it calculation workbook is allowed to go on opening. 3. If allowed sec.xls should place "OK" in calculation workbooks H1, otherwise "NO" Everything went just fine but I can't activate my workbook which calls sec.xls. So OK is placed in sec.xls instead of the original workbook. Is it ok using that calling workbook as a string in A6? Any ideas how to solve this or even make it any simplier. I am not familiar with the public variables if it's any solution. frombook = Sheets("id").Range("A6").Value Workbooks(frombook).Activate This is the line it accepts but won't work as it should. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activating problem
What do you put in H6?
Do you use just the name of the file or do you include the entire path? You only want the name--not the path. Do you include the extension of the file in H6? Make sure you include the extension. Jasoni wrote: I might have too complicated idea to secure my workbooks but....... I used to have security macro in each of my workbooks which tested harddrives serialnumber. Chancing and adding a computer makes it too hard work to edit all of those workbooks to add new serials. So I made an external sec.xls file which do the trick. 1. When a calculation workbook (auto-open macro) is opened it opens sec.xls in the very same folder where it was started and adds a workbooks name inside sec.xls to A6 as string, which calls it. So it can come back to original workbook. 2. According to sec.xls (auto-open macro) calculation it should compare it calculation workbook is allowed to go on opening. 3. If allowed sec.xls should place "OK" in calculation workbooks H1, otherwise "NO" Everything went just fine but I can't activate my workbook which calls sec.xls. So OK is placed in sec.xls instead of the original workbook. Is it ok using that calling workbook as a string in A6? Any ideas how to solve this or even make it any simplier. I am not familiar with the public variables if it's any solution. frombook = Sheets("id").Range("A6").Value Workbooks(frombook).Activate This is the line it accepts but won't work as it should. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activating problem
Yes, to both of the questions.
For example there is in a A6: text string "test.xls" "Dave Peterson" kirjoitti ... What do you put in H6? Do you use just the name of the file or do you include the entire path? You only want the name--not the path. Do you include the extension of the file in H6? Make sure you include the extension. Jasoni wrote: I might have too complicated idea to secure my workbooks but....... I used to have security macro in each of my workbooks which tested harddrives serialnumber. Chancing and adding a computer makes it too hard work to edit all of those workbooks to add new serials. So I made an external sec.xls file which do the trick. 1. When a calculation workbook (auto-open macro) is opened it opens sec.xls in the very same folder where it was started and adds a workbooks name inside sec.xls to A6 as string, which calls it. So it can come back to original workbook. 2. According to sec.xls (auto-open macro) calculation it should compare it calculation workbook is allowed to go on opening. 3. If allowed sec.xls should place "OK" in calculation workbooks H1, otherwise "NO" Everything went just fine but I can't activate my workbook which calls sec.xls. So OK is placed in sec.xls instead of the original workbook. Is it ok using that calling workbook as a string in A6? Any ideas how to solve this or even make it any simplier. I am not familiar with the public variables if it's any solution. frombook = Sheets("id").Range("A6").Value Workbooks(frombook).Activate This is the line it accepts but won't work as it should. -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Activating problem
If test.xls isn't open, it'll cause a problem.
And you're positive that it's spelled correctly??? Jasoni wrote: Yes, to both of the questions. For example there is in a A6: text string "test.xls" "Dave Peterson" kirjoitti ... What do you put in H6? Do you use just the name of the file or do you include the entire path? You only want the name--not the path. Do you include the extension of the file in H6? Make sure you include the extension. Jasoni wrote: I might have too complicated idea to secure my workbooks but....... I used to have security macro in each of my workbooks which tested harddrives serialnumber. Chancing and adding a computer makes it too hard work to edit all of those workbooks to add new serials. So I made an external sec.xls file which do the trick. 1. When a calculation workbook (auto-open macro) is opened it opens sec.xls in the very same folder where it was started and adds a workbooks name inside sec.xls to A6 as string, which calls it. So it can come back to original workbook. 2. According to sec.xls (auto-open macro) calculation it should compare it calculation workbook is allowed to go on opening. 3. If allowed sec.xls should place "OK" in calculation workbooks H1, otherwise "NO" Everything went just fine but I can't activate my workbook which calls sec.xls. So OK is placed in sec.xls instead of the original workbook. Is it ok using that calling workbook as a string in A6? Any ideas how to solve this or even make it any simplier. I am not familiar with the public variables if it's any solution. frombook = Sheets("id").Range("A6").Value Workbooks(frombook).Activate This is the line it accepts but won't work as it should. -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activating/De-activating buttons | Excel Programming | |||
Problem activating OLEObjects | Excel Programming | |||
Activating Worksheet Controls - "Excel VBA Problem" | Excel Programming | |||
Problem activating a sheet | Excel Programming | |||
Problem in activating a sheet | Excel Programming |