macro record function to perform tasks in other applications

spurs

Active Member
Joined
Oct 18, 2006
Messages
479
Office Version
  1. 2016
  2. 2013
  3. 2010
  4. 2007
  5. 2003 or older
Platform
  1. Windows
Is there a way to use the macro record function in excel to continue to record the tasks associated with opening up another application and performing mouse and keyboard functions within that other application?

How can this be done?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Not sure I understand exactly what you're asking but it sounds like you're possibly looking at something like AutoHotKey.
 
Upvote 0
Is there a way to use the macro record function in excel to continue to record the tasks associated with opening up another application and performing mouse and keyboard functions within that other application?
No, once you've left Excel the Excel macro recorder can't know what you are doing.

However you can control other Microsoft Office applications and Internet Explorer from an Excel macro. You can also communicate with other DDE-compliant applications.
 
Upvote 0
I am trying to control a 3D cad program - Solidworks by using calculations from withing Excel to draw an object in Solidworks.

My preference is to have excel vba open up solidworks (program is solidworks.exe) and then perform the tasks in solidworks that I would otherwise need to use the mouse and keyboard to perform.

After the solidworks file is saved, I want the screen go back to where I started in excel.

Can you guide me on how at least to get started to shell over to Solidworks.com?
 
Upvote 0
Check whether SolidWorks is DDE compliant.

The VBA command is Shell. Call it with the full path to the executable. You can also specify whether the window is to be opened minimised or maximised and with/without focus.

If you start typing the shell command in the VBA editor followed by a space, you will get a pop-up telling you what the syntax of the command is and what the parameters are.
 
Upvote 0
I tried the shell command including the full path which i verified on my system as follows:

shell "C:\Program Files\SolidWorks Corp\SolidWorks\SolidWorks.exe",vbNormalFocus

I get an error back telling me file not found

I verified the path by pasting C:\Program Files\SolidWorks Corp\SolidWorks\ into explorer and the program solidworks.exe exists in that directory and launches when I click on it.

am I missing something else?
 
Upvote 0
Check that it's a Windows application. DOS applications are handled differently.

Check that it's not a shortcut. You have to shell to the EXE file itself.

Try copying the EXE file to your Home folder and shelling to it from there (to verify that it's not a permissions issue). It may not get as far as loading fully but if it gets past the "File not found" message and starts to appear then it's a permissions issue.
 
Upvote 0
also, what i do is right click on the toolbar, customize, macros, custom button. then edit that button and add a hyperlink to the specific file that you want to open. This way when you press that button, the excel will open Solidworks and that file.
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top