Windows Scripting Host/Windows XP

V

V. Roe

I have been using a small piece of code found on the newsgroup to create a
shortcut to an excel file. This has worked fine until we started upgrading
to Windows XP. It works fine on stand alone machines, but hangs up on the
"Save" line on our networked machines. The network administrator will give
me access to the security password if it can be written into code, but I do
not even know where to begin. If anyone can assist me or knows a workaround,
I would greatly appreciate your help. Below is the code I am using.
Thanks for your help.
Valerie

'Creates Shortcut to file

Set WshShell = CreateObject("Wscript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")

Set OShellLink = WshShell.CreateShortcut(strDesktop & "\Daily Sales " &
Range("a1").Text & ".lnk")

With OShellLink
.TargetPath = ActiveWorkbook.FullName
.WindowStyle = 4
.Save
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top