Shell for non .exe Files

JValenti

New Member
Joined
Mar 7, 2018
Messages
11
Hello All,


So I currently am trying to open from VBA, an output file of a macro recordercalled tinytask. I am able to sue theshell function to open the macro recorder itself using the below:

Sub TinyTaskCallExample()

DimstrProgramName As String
Dim strArgumentAs String

'strProgramName= "C:\Users\vajo5001\Desktop\tinytask.exe"

'Call Shell(strProgramName,vbNormalFocus)

End Sub


However, when you save a recording file from the programit saves the file as a .rec file type. Sofor example my file could be called "C:\Users\vajo5001\Desktop\OpenWord.rec". When looking at the file properties it showsOpens With: TinyTask. I just doubleclick on the file on my desktop it loads with no issues and runs the recorded macro.

So how do I open a non-standard filetype such asthis? Is it still with the Shell programand I am just formatting incorrectly?
Replacing with 'strProgramName = " C:\Users\vajo5001\Desktop\OpenWord.rec" does not work.
Thanks Josh
 
Last edited:

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Josh

Does this work?
Code:
Sub TinyTaskCallExample()

Dim strProgramName As String
Dim strArgument As String

    strProgramName= "C:\Users\vajo5001\Desktop\tinytask.exe"


    strArgument = "OpenWord.rec"

    Call Shell(strProgramName & " " & strArgument ,vbNormalFocus)

End Sub
 
Upvote 0
Code:
Shell "cmd /c " & "C:\Users\vajo5001\Desktop\OpenWord.rec", vbNormalFocus
 
Upvote 0
Hello Norie,

Yes that seems to have worked, and I was also able to get the following to work:

Shell ("C:\Users\vajo5001\Desktop\tinytask.exe C:\Users\vajo5001\Desktop\OpenWord.rec"

I think they are basically the same thing
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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