Refering to Desktop

  • Thread starter Thread starter Lynda
  • Start date Start date
L

Lynda

How between two ""

refer to the desktop within windows xp.

for example -

a:\hello.doc
is floppy

.../../docs&settings//desktop

or something will always give you the desktop!

I dont know if you but please tell me if you can!

Lynda
 
Try this Lynda

Sub DesktopExample()
Dim WSHShell As Object
Dim DesktopPath As String
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
MsgBox DesktopPath
Set WSHShell = Nothing
End Sub
 
Sub ExportChartJPG()
ActiveChart.Export Filename:="Desktop Example",
FilterName:="jpeg"
End Sub

Ron I have tried to put your code in a module with my
other code but it does not work. how do I tell it to find
out the location of the desktop to look at the code in
the module?

-----Original Message-----
Try this Lynda

Sub DesktopExample()
Dim WSHShell As Object
Dim DesktopPath As String
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
MsgBox DesktopPath
Set WSHShell = Nothing
End Sub




--
Regards Ron de Bruin
http://www.rondebruin.nl



"Lynda" <[email protected]> wrote in
message news:[email protected]...
 
Sub DesktopExample()
Dim WSHShell As Object
Dim DesktopPath As String
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
ActiveChart.Export Filename:=DesktopPath & "\" & "Desktop Example.jpg", _
FilterName:="jpeg"
Set WSHShell = Nothing
End Sub
 

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

Back
Top