hello friends,
I want to ask you if it's possible to run a macro on a specific pc, I mean to use a workbook.
a sort of protection.
any help is really appreciated
chris
hello friends,
I want to ask you if it's possible to run a macro on a specific pc, I mean to use a workbook.
a sort of protection.
any help is really appreciated
chris
Last edited by chris85; 12-20-2010 at 05:10 AM.
Try this:
Please Login or Register to view this content.
hi mojo,
thanks for your solution! i'll try it tmw n i tell you!
chris
hi
I rcv an error variable not define!
have anybody any ideea how could it be solved?
thx in advance
chris
Last edited by chris85; 12-19-2010 at 11:09 AM.
Perhaps this will work better?
To find your computer name as your systen sees it you could add the linePlease Login or Register to view this content.
before the linePlease Login or Register to view this content.
When I checked my computer name in "Control Panel" -> System it was a mix of lower case letters and numbers but the value shown in thePlease Login or Register to view this content.
MsgBox was upper case letters and numbers. So I had to change computer name in my macro to upper case letters to get it to work.
HTH
Alf
Last edited by Alf; 12-19-2010 at 12:19 PM.
Alf, thx!
i'll try right now!
christian
Alf, i added the code and i'm expecting not to work on other pc except mine, i mean that defined!
here is my code, did i do something wrong?
Please Login or Register to view this content.
Yes, you did something wrong.
Your first macro isn't doing anything.
Your second macro needs to be within your first macro as the "Else" part of your "If".
hi Cutter,
thank you for response! kindly ask you to correct my code if you want!
chris
Is your second macro doing what you want it to do as it is currently written?
Yes, it does.
i just want not to run it on other pc, that's all!
thank you very much
christian
That being the case, try this:
Please Login or Register to view this content.
thx, i'll try n i tell you!
chris
hi,
sorry, it's not working.
chris
How is it "not working"?
Is it running as expected on your computer AND on another?
Is it not running as expected on your computer OR on another?
Are you getting an error when you run it?
Does anything happen when you run it?
You need to provide more information.
Run this macro on YOUR computer as a test:
If you don't get a message box after running this macro then you are using the wrong name for your computer which means you didn't read and follow post #5 properly.Please Login or Register to view this content.
hi Cutter, good morning!
thank you for your help. i have no ideea why the code did not working properly, actually it was working on any pc.
i read post 5 for several times, i deleted all n then i added the code again. it works very well.
please do not get at me, i'm just a beginner!
i appreciate your patience and help.
chris
Good morning Chris
I wasn't "getting at you". I was just asking for a clearer explanation and suggesting what you can try so that we can provide you with the appropriate assistance.
Glad to hear you got it to work.
hi Cutter,
thx!
chris
Chris
When you say it is not working, do mean that the macro is throwing an error message or that your own macro is working under all circumstances, ie on any PC?
David
Access and Excel Developer | UK
David,
it was working on any pc without error msg(s), then the issue was solved.
i'm learning...
Chris
Chris
Me too. Missed page two of these posts altogether. Beginner.
One thing I am not up to judging yet on this Forum is that when people are exchanging code how far should I go as a potential contributor. For instance, in the code featured in this thread, nobody is talking error handling or code structuring. Should I be concerned at this?
Nobody is talking about error because there was no error, not being an expert I'm not worried about code structuring. as i said, it's ok now!
Hi David
You of course do the best as you can with the available information. If you have read a number of posts in this forum you find that quite often the OP comes back with additional questions because they did not give enough or sometimes wrong information the first time because the OP’s having spent so much time trying to solve the problem that they forget to mention the obvious, i.e. obvious to them but not to one trying to help.that when people are exchanging code how far should I go as a potential contributor
If I may refer to the specific code I wrote I did test it before I presented it as a solution to a specific problem. In the testing I found a discrepancy between the computer name found in “System Properties” compared to what the macro showed in “MsgBox”. I did comment on this and proposed how to check what name to use. Normally I test to check that the code works and if so I usually post it with a friendly HTH.For instance, in the code featured in this thread, nobody is talking error handling or code structuring. Should I be concerned at this?
Code structuring? I do start macros with “Option Explicit” and “Dim” the variables because I find it easier to analyze my code but I seldom comment the different statement, the how and the why. I guess it’s a matter of personal preference and how much time I can spend. If the OP wants more information they may ask and I’ll do my best to answer. And if I give a wrong answer hopefully somebody else in the forum will correct me and give the right answer.
Looking at posts it seems to me that they who make a living out of working with Excel tends to give better solutions, better i.e. that is they do add a number of comment in the macros and they also do tend to ask question of the OP so their solutions are more fool proof. But they are used to work with customers who not always know what they need. Me I’m still learning so that reflects on the quality of my answers.
Alf
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks