Hello!
I have a couple of very simple VBA Macros in Excel 2004 that save me a lot of time each week. I would like to convert them to AppleScript so I can use them in Excel 2008.
From what I understand I should be able to do this with AppleScript, but I have never used it before and have absolutely no idea what I am doing.
Not only do I need to know how to convert the VBA to AppleScript, I need to know what to do to make it run in Script Editor, etc.
There are two VBA Macros, each is to highlight a specified cell range, then turn on cell protection.
It is my understanding that although I couldn't record this into my VBA Macro, AppleScript will also let me unprotect the worksheet at the beginning of the script, and then re-protect it at the end of the script. If someone can help me convert these, adding that in would be great.
I'd really appreciate your help.
Here is the first one called partial_lock. I would only need to have the command added to the end of this one to protect the sheet with the password = correct
Sub partial_lock() ' ' partial_lock Macro ' Macro recorded 1/9/2008 by LIFEMW ' ' Range("C6:Z299").Select Selection.Locked = False Selection.FormulaHidden = False ActiveWindow.ScrollColumn = 1 ActiveWindow.ScrollRow = 5 Range("C6:M299").Select Selection.Locked = True Selection.FormulaHidden = False End Sub
Here is the second one called full_lock. This one needs to have the worksheet unprotected at the beginning with the password = correct and then it needs have the command added at the end to protect the worksheet with the password = correct
Sub full_lock() ' ' full_lock Macro ' Macro recorded 1/9/2008 by LIFEMW ' ' Range("C6:Z299").Select Application.CutCopyMode = False Selection.Locked = True Selection.FormulaHidden = False End Sub
Thank you!!!!
Kelly![]()
Last edited by VBA Noob; 10-17-2008 at 05:26 PM.
Hello kbraaten,
Your question is beyond the scope of this forum as AppleScript applies only to Macs and their operating systems. As Mac no longer supports VBA in the 2008 edition, you may find this web page helpful.
Mactopia
Sincerely,
Leith Ross
Thanks Leith, I've read it all and unfortunately am too much of a newbie to put all the dots together.
Kelly
Hello Kelly,
Have you tried any posting your question with a Mac Users Group?
Sincerely,
Leith Ross
kbraaten,
Please read forum rules below. You're code was wrapped for you this time but you still need to add the link to the other excel forum as cross posting without the link is not permitted
VBA Noob
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Sorry, thought being told I wasn't supposed to post that question here meant I should go elsewhere.
I have also posted the question at
http://www.mrexcel.com/forum/showthr...=1#post1717724
Kelly
Hello Kelly,
I found another site that may be what you need. This covers converting Excel macros into AppleScript.
MacTech
Sincerely,
Leith Ross
Thanks Leith! I'll definitely read it!
Kelly
Leith - you're awesome! I found everything I need and my AppleScript works perfectly!
Not sure how to change this one to solved, but it is!
Kelly
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks