Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Desktop icon

Can I call Access from a desktop short with with VBA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Desktop icon


You need to run the DLL ShellExecute. I assumed the Icon was in you
poersonnal DeskTop and not the All Users. I tested with Spybot but you
can use any ICON.



Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub test()

IConName = "Spybot - Search & Destroy"

HomePath = Environ("HomeDrive") & Environ("Homepath")
DeskTop = HomePath & "\" & "DeskTop"


RetVal = ShellExecute(0, "open", IConName, "<arguments", _
DeskTop, SW_SHOWMAXIMIZED)


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170758

Microsoft Office Help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 337
Default Desktop icon

I get the following compile error when I try to run this
"Constants,fixed- length strings,arrays, user dedined type and Declare
statementsnot allowed as Public member of object modules"

Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub test()

IConName = "Customers.mdb - Shortcut"

HomePath = Environ("HomeDrive") & Environ("Homepath")
DeskTop = HomePath & "\" & "DeskTop"


RetVal = ShellExecute(0, "open", IConName, "<arguments", _
DeskTop, SW_SHOWMAXIMIZED)


End Sub

"joel" wrote:


You need to run the DLL ShellExecute. I assumed the Icon was in you
poersonnal DeskTop and not the All Users. I tested with Spybot but you
can use any ICON.



Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub test()

IConName = "Spybot - Search & Destroy"

HomePath = Environ("HomeDrive") & Environ("Homepath")
DeskTop = HomePath & "\" & "DeskTop"


RetVal = ShellExecute(0, "open", IConName, "<arguments", _
DeskTop, SW_SHOWMAXIMIZED)


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170758

Microsoft Office Help

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Desktop icon


I copied the code exactly from the posting and did not get any errors.
Put the code below on a new module exactly as posted and see if you get
any errors with no other macros. I put the code in a VBA module. theis
code should work in excel 2000 and above.

Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub test()

IConName = "Customers.mdb - Shortcut"

HomePath = Environ("HomeDrive") & Environ("Homepath")
DeskTop = HomePath & "\" & "DeskTop"


RetVal = ShellExecute(0, "open", IConName, "<arguments", _
DeskTop, SW_SHOWMAXIMIZED)


End Sub

"joel" wrote:


You need to run the DLL ShellExecute. I assumed the Icon was in you
poersonnal DeskTop and not the All Users. I tested with Spybot but

you
can use any ICON.



Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias
"ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long


Sub test()

IConName = "Spybot - Search & Destroy"

HomePath = Environ("HomeDrive") & Environ("Homepath")
DeskTop = HomePath & "\" & "DeskTop"


RetVal = ShellExecute(0, "open", IConName, "<arguments", _
DeskTop, SW_SHOWMAXIMIZED)


End Sub


--
joel

------------------------------------------------------------------------
joel's Profile: 229
View this thread: 'Desktop icon - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=170758)

'Microsoft Office Help' (http://www.thecodecage.com)

.



--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170758

Microsoft Office Help

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control desktop Icon Snowfire Excel Programming 2 February 2nd 08 07:45 PM
Desktop File Icon Josh O. Setting up and Configuration of Excel 3 August 23rd 07 09:30 PM
Desktop icon name Les Stout[_2_] Excel Programming 4 March 6th 07 02:29 PM
how can i put the excel icon on my desktop? petre Excel Discussion (Misc queries) 4 February 20th 05 05:29 PM
Delete desktop icon with VBA Francis Ang Excel Programming 1 May 26th 04 10:25 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"