ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Activating problem (https://www.excelbanter.com/excel-programming/418028-activating-problem.html)

Jasoni

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.




Dave Peterson

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

Jasoni[_2_]

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




Dave Peterson

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


All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com