Guraknugen
New Member
- Joined
- Mar 15, 2017
- Messages
- 35
Hi!
I have a simple function for returning the desktop path, and it has worked fine until now:
From one day to another, running it suddenly throws this error message (translated from Swedish):
The line causing this seems to be "GetDesktopPathName = oWSHShell.SpecialDirs("Desktop")"
What might cause this?
Is there a setting I need to do somewhere?
I have a simple function for returning the desktop path, and it has worked fine until now:
Code:
Public Function GetDesktopPathName() As String
Dim oWSHShell As Object
Set oWSHShell = CreateObject("WScript.Shell")
GetDesktopPathName = oWSHShell.SpecialDirs("Desktop")
Set oWSHShell = Nothing
End Function
From one day to another, running it suddenly throws this error message (translated from Swedish):
Runtime error 438
Object doesn't support the method or property.
The line causing this seems to be "GetDesktopPathName = oWSHShell.SpecialDirs("Desktop")"
What might cause this?
Is there a setting I need to do somewhere?