Launch Shortcut through VBA

joefrench

Active Member
Joined
Oct 4, 2006
Messages
357
Is it possible to launch a program through desktop shortcut with VBA? I have the following code and it is giving me an 'Invalid procedure call or argument' error
Edit: Typing the string into the Run command works fine.
Code:
'Launch ProE
Dim objWsh As Object, _
    strDesktop As String

Set objWsh = CreateObject("WScript.Shell")
strDesktop = objWsh.SpecialFolders("Desktop") & "\Wildfire 3.0.lnk"

Set objWsh = Nothing

'Debug.Print strDesktop

Shell strDesktop, vbMaximizedFocus
 
Last edited:

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Strange... I use similar code and it never failed...
I don't have access to the code at home, so I can check it on Monday earliest, but it is very similar, and it should work...

I've tried something here, but I get the same error...
By the way: you can also get to the Desktop folder via:

Code:
DesktopFolder = Environ("USERPROFILE") & "\Desktop\"

I usually find that easier to remember than the Shell scripting object...

I hope someone gives an answer earlier, but I'll check back on Monday!
 
Upvote 0
Thank you Hermanito. I really appreciate it! I'll give what you have there a try...

I'm still chasing that ambitious goal! :biggrin:
Only now I am not chasing the Purge.bat file function......doing that all through excel as well (still working on it actually).
 
Upvote 0
So, you still haven't convinced management? :biggrin:

I see you're already using Wildfire 3... we're still on 2.
I saw that WF4 was released a few days ago...
And we're still on Intralink 3.3 :(
Very buggy, that one...
There's been talk of an upgrade to 3.4 for 4 or 5 months now...

The code I mentioned that is similar is actually also used for Pro/E and Intralink purposes... it's used to call a batch file, that in turn calls an Intralink Java scriptfile to automatically create BOM's, export them to textfiles and read them into Excel. All automatically without the user having to go to Intralink once... I'm quite proud of that one :)
It even does a lot more than I can explain in a few lines, but I can tell that my colleagues are very happy to use it ;)
 
Upvote 0
So, you still haven't convinced management?

Not even close. They sure are all about me getting this put together though. We'll see how that works out for them after all of the overtime I'll be putting into this! :laugh: I'm actually quite excited about getting to do this.

I see you're already using Wildfire 3... we're still on 2.
I saw that WF4 was released a few days ago...
And we're still on Intralink 3.3
Very buggy, that one...
There's been talk of an upgrade to 3.4 for 4 or 5 months now...

Yeah....we've been on WF3 for about a year now. I've actually loaded pre-production WF4 and have played around with it a bit and had gone to an introduction to WF4 a few months ago. Wow does that have some nice new tools!! It's been released in production now....just waiting for our IT dept. to get it loaded.

Still no Windchill, eh?

The code I mentioned that is similar is actually also used for Pro/E and Intralink purposes... it's used to call a batch file, that in turn calls an Intralink Java scriptfile to automatically create BOM's, export them to textfiles and read them into Excel. All automatically without the user having to go to Intralink once... I'm quite proud of that one
It even does a lot more than I can explain in a few lines, but I can tell that my colleagues are very happy to use it

That is something to be proud of....and very cool too!

I've been kind of focused on keeping employees from having to root through the file navigator (Windows Explorer) as much as possible. Just scares me to see people try to find stuff and to give them the oportunity to delete files. So I've been using excel to generate html files with links to the files that are required (pdf's [of detailed drawings], html [that has other data generated by excel], etc...). Has been quite fun/interesting!
 
Upvote 0
Already a year on WF3 and playing with WF4.... I'm very jealous now! :eeek:
And we have not even got Windchill yet, indeed! GRRRRRMMBL

My macrofile is currently being used to handle the release process in our company, that is (IMHO overly) complex...
It handles
- automatic data gathering from Intralink
- checking that data for nasty bugs (Thanks PTC!)
- warning the user if the bugs cannot be auto-corrected
- automatic data gathering from SAP
- automatic data gathering from (if any) previous release documents.
- a complex set of manipulations to compare all this data
- letting the user intervene and add any extra info for the release
- automatic emailing to (editable) predefined lists of persons with info about the new release.
- creating pdf- and dxf-files as well as eDrawings via a tool that our ProE-support guy wrote in C++
- gathering all these datafiles in a new releasedata folder (without having users have to copy them from different locations)
- making final boms to upload directly into SAP again (the uploading is done with another tool)
- edit: almost forgot: all actions and macro progress is logged for each user... (so they don't have plausible deniability anymore, hehe)

This process could easily take a few hours to half a day for a single release in the days before my macro existed, almost everything had to be done by hand, there were some very basic macro's available for some of the manipulation tasks.
Now, a full release can be done in under 15 minutes (provided there aren't any unforeseen troubles)

I've saved them man-months already, what do you think my payrise was for all the effort? :(

So, that's enough bragging for now... is it too obvious I get way too little credit for this at work? :biggrin::biggrin:

By the way: do you know if Windchill/PDM has the same Java scripting capabilities as Intralink?
 
Last edited:
Upvote 0
Already a year on WF3 and playing with WF4.... I'm very jealous now!
And we have not even got Windchill yet, indeed! GRRRRRMMBL
Skip WF3 and go straight to WF4. Not a whole lot of advances in WF3 over WF2.....and just as many (what we call Pro/Boot or the autoExitOption).

My macrofile is currently being used to handle the release process in our company, that is (IMHO overly) complex...
It handles
- automatic data gathering from Intralink
- checking that data for nasty bugs (Thanks PTC!)
- warning the user if the bugs cannot be auto-corrected
- automatic data gathering from SAP
- automatic data gathering from (if any) previous release documents.
- a complex set of manipulations to compare all this data
- letting the user intervene and add any extra info for the release
- automatic emailing to (editable) predefined lists of persons with info about the new release.
- creating pdf- and dxf-files as well as eDrawings via a tool that our ProE-support guy wrote in C++
- gathering all these datafiles in a new releasedata folder (without having users have to copy them from different locations)
- making final boms to upload directly into SAP again (the uploading is done with another tool)
- edit: almost forgot: all actions and macro progress is logged for each user... (so they don't have plausible deniability anymore, hehe)

This process could easily take a few hours to half a day for a single release in the days before my macro existed, almost everything had to be done by hand, there were some very basic macro's available for some of the manipulation tasks.
Now, a full release can be done in under 15 minutes (provided there aren't any unforeseen troubles)

I've saved them man-months already, what do you think my payrise was for all the effort?

So, that's enough bragging for now... is it too obvious I get way too little credit for this at work?

All I can say is WOW!!! That is exremely impressive!! It sounds like you've basically created an add-on of sorts to Intralink!:pray: Our release process isn't that intense but it's more than it needs to be (we still use a typewriter for a portion of it....ridiculous!).

And I understand the "Too Little Credit" part. I'm in the same boat.

By the way: do you know if Windchill/PDM has the same Java scripting capabilities as Intralink?
I wish I could tell ya.This is where I get my PTC/ProE questions answered.
 
Upvote 0
All I can say is WOW!!! That is exremely impressive!! It sounds like you've basically created an add-on of sorts to Intralink! Our release process isn't that intense but it's more than it needs to be (we still use a typewriter for a portion of it....ridiculous!).

Aha, finally some credit :biggrin:
And a typewriter? Wow... and here I was, thinking WE were overdoing it...
My colleagues should all be acting like your smiley :biggrin:

And I understand the "Too Little Credit" part. I'm in the same boat.
Maybe we can start a self-help group for under-appreciated PTC-automators :rofl:
Only yesterday a colleague told me: "I've found a bug in your macro", I replied: "That's impossible!". I left him baffled for a few seconds, then added: "It's possible there's a bug in it, but it's impossible that YOU found it!". Hehehe, I can't complain about the colleagues, I can pull their legs so easily ;)

That's a nice forum to add to my list... I'll have to keep this link...
 
Upvote 0
Aha, finally some credit

From what I've read.....Well deserved!

And a typewriter? Wow... and here I was, thinking WE were overdoing it...

Yeah....we've actually come a long way since I started here 4 1/2 yrs ago. Getting rid of that typewriter will be a huge accomplishment! I've hated that thing since I first saw it!
Next up after that.....the E-size plotter. Why make prints anymore....right?

My colleagues should all be acting like your smiley

I can't believe they're not! How long did it take you to develop that?

Maybe we can start a self-help group for under-appreciated PTC-automators
You can count me in!! :biggrin:

Only yesterday a colleague told me: "I've found a bug in your macro", I replied: "That's impossible!". I left him baffled for a few seconds, then added: "It's possible there's a bug in it, but it's impossible that YOU found it!".

:rofl: That's hilarious!!
I have so many bugs in what I've developed (mainly due to premature launch forced by upper management) that I am never surprised that there is a problem. I've been able to work most of them out after learning so much on this forum.

That's a nice forum to add to my list... I'll have to keep this link...

It's a lot like this forum.....very friendly people that are willing to help you out. (Of course you can tell some of them are slightly frustrated by the PTC product! :rofl:)
 
Upvote 0

Forum statistics

Threads
1,224,557
Messages
6,179,507
Members
452,917
Latest member
MrsMSalt

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