Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Hide Access when macro run from Excel

I have copied the following code from the MS KB - it works OK but how can I
stop Access becoming visible while the macro runs?

Sub Run_Access_Macro()

Application.ScreenUpdating = False
'Opens Microsoft Access and the file nwind.mdb
Shell ("c:\program files\microsoft office\office\msaccess.exe
c:\apps\data\access\myfile.mdb")

'Initiates a DDE channel to Microsoft Access
Chan = DDEInitiate("MSACCESS", "system")
'Activates Microsoft Access
Application.ActivateMicrosoftApp xlMicrosoftAccess
'Runs the macro "Sample AutoExec" from the NWIND.MDB file
Application.DDEExecute Chan, "mymacro"
'Terminates the DDE channel
Application.DDETerminate Chan

Application.ScreenUpdating = True
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Hide Access when macro run from Excel

If you can convert the macro to VBA then something like this may work.

Dim appAccess, strConPathToDB
strConPathToDB = "D:\data\Access\db1.mdb"
Set appAccess = CreateObject("Access.Application.10")
appAccess.OpenCurrentDatabase strConPathToDB
appAccess.DoCmd.OpenModule "Module1", "SomeProc"
appAccess.Quit

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"Snowsride" wrote:
|I have copied the following code from the MS KB - it works OK but how can I
| stop Access becoming visible while the macro runs?
|
| Sub Run_Access_Macro()
|
| Application.ScreenUpdating = False
| 'Opens Microsoft Access and the file nwind.mdb
| Shell ("c:\program files\microsoft office\office\msaccess.exe
| c:\apps\data\access\myfile.mdb")
|
| 'Initiates a DDE channel to Microsoft Access
| Chan = DDEInitiate("MSACCESS", "system")
| 'Activates Microsoft Access
| Application.ActivateMicrosoftApp xlMicrosoftAccess
| 'Runs the macro "Sample AutoExec" from the NWIND.MDB file
| Application.DDEExecute Chan, "mymacro"
| 'Terminates the DDE channel
| Application.DDETerminate Chan
|
| Application.ScreenUpdating = True
| End Sub
|


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
How do I hide the Quick Access Toolbar in Excel 2007? D7 Excel Discussion (Misc queries) 2 November 17th 09 02:27 AM
hide 0 values in quick access toolbar (Excel 2007) Jaap van der Velden Excel Worksheet Functions 0 January 12th 09 01:28 PM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Trigger a Macro in MS Access from an Excel Macro? DonRetd Excel Programming 13 March 30th 05 09:52 PM
Launch Macro in Access via Macro running in Excel??? dgrant Excel Programming 1 September 24th 03 01:38 PM


All times are GMT +1. The time now is 05:38 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"