Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Open File, pause macro until file is selected


--
Jim
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Open File, pause macro until file is selected

Sorry, my post was not complete.

I have recorded macro that goes to a specifc directory and opens a Access DB
and then I select the table and it is populated to my spreadsheet.
Whta I want to be able to do is, once thee table window opens allow the user
to select the table they want to import and then finish running hte macro.

The Macro;



Sub Macro1()

ChDir "C:\Scc\db"
Workbooks.OpenDatabase Filename:="C:\Scc\db\db1.mdb",
CommandText:=Array( _
"UsageReport1"), CommandType:=xlCmdTable
End Sub
--

Jim


"Jims" wrote:


--
Jim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Open File, pause macro until file is selected

You can replace Arrray wirth a variable like shown below. You can set
myarrray to different string depending on which table is selected by the user.

Sub Macro1()

ChDir "C:\Scc\db"
myArray = Array("UsageReport1"),
Workbooks.OpenDatabase Filename:="C:\Scc\db\db1.mdb",
CommandText:=myArray, CommandType:=xlCmdTable
End Sub

"Jims" wrote:

Sorry, my post was not complete.

I have recorded macro that goes to a specifc directory and opens a Access DB
and then I select the table and it is populated to my spreadsheet.
Whta I want to be able to do is, once thee table window opens allow the user
to select the table they want to import and then finish running hte macro.

The Macro;



Sub Macro1()

ChDir "C:\Scc\db"
Workbooks.OpenDatabase Filename:="C:\Scc\db\db1.mdb",
CommandText:=Array( _
"UsageReport1"), CommandType:=xlCmdTable
End Sub
--

Jim


"Jims" wrote:


--
Jim

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
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Excel file does not open when selected airnet Excel Discussion (Misc queries) 2 July 21st 08 08:36 PM
Macro To Open a User selected File Chris Excel Worksheet Functions 2 September 6th 07 08:58 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Pause Macro For Start Row While Parsing a Text File Bill Foster[_2_] Excel Programming 2 November 9th 05 08:47 PM


All times are GMT +1. The time now is 02:52 AM.

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"