Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default compact Access DB from Excel

one solution?, command line approach

CreateObject("WScript.Shell").Run "MSAccess " & _
Chr(34) & ActiveWorkbook.Sheets("Info").Range("C5") & _
Chr(34) & "/runtime /compact", 0, True

HTH

"JT" wrote:

I'm using the following code in Excel to allow users to compact their Access
database.

vDB = ActiveWorkbook.Sheets("Info").Range("C5")

Set AppAcc = New Access.Application
AppAcc.Visible = False
AppAcc.OpenCurrentDatabase vDB

DoCmd.SetWarnings False

AppAcc.CommandBars("Menu Bar").Controls("Tools").Controls("Database
utilities"). _Controls("Compact and repair database...").accDoDefaultAction

DoCmd.SetWarnings True
AppAcc.Visible = True
AppAcc.Quit acQuitSaveNone

Set AppAcc = Nothing

I would like to do a couple of things differently:

(1) I would like to change the directory the users will see on the dialog
box instead of the path and directory where the macro resides.

(2) I would like to display a message if the users selects the "cancel"
option instead of saving the database.

Is it possible to do make either one of these changes? Any help getting
started would be appreciated. Thanks for the help...
--
JT

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
Compact or Shrink down excel file James C. Excel Discussion (Misc queries) 3 June 18th 07 09:42 PM
HOW TO COMPACT AN EXCEL FILE CAPTGNVR Excel Discussion (Misc queries) 3 February 1st 07 07:34 PM
compact MS Access while list box connected to database in spreadsheet [email protected] Excel Programming 1 December 2nd 05 08:55 AM
Compact Excel Spreadsheet Newbie Excel Programming 1 February 11th 04 08:41 PM
How to compact an Excel file with VBA Neil Bhandar Excel Programming 1 October 1st 03 02:58 AM


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

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

About Us

"It's about Microsoft Excel"