×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

"Repeat Last Command" macro

"Repeat Last Command" macro

"Repeat Last Command" macro

(OP)
Let me start by saying I have plenty of experience with Excel VBA but none with Solidworks VBA.
I am looking to add a button to the 'shortcut' toolbar that will repeat the last command. I currently have 'R' as my keyboard shortcut, but want to be able to click a button instead.
cheers.

RE: "Repeat Last Command" macro

The quick'n'dirty way would be SendKeys("R")

-handleman, CSWP (The new, easy test)

RE: "Repeat Last Command" macro

Hitting Enter repeats last command as well.

RE: "Repeat Last Command" macro

(OP)
The 'SendKeys' method does not work for me.

If I have VBA Editor closed the only thing that happens is NumLock is turns off.

If I have VBA Editor open & then run the macro from SW it will
1. Turn off NumLock
2. Insert letter 'R' into code

So I know the code is sending 'R', but SW is not responding.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources