ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refering to Desktop (https://www.excelbanter.com/excel-programming/322074-refering-desktop.html)

lynda

Refering to Desktop
 
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

Ron de Bruin

Refering to Desktop
 
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" wrote in message ...
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




No Name

Refering to Desktop
 
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" wrote in

message ...
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



.


Dave Peterson[_5_]

Refering to Desktop
 
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



wrote:

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" wrote in

message ...
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



.


--

Dave Peterson


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com