Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to format a Docmd to pull in an Access file in Text format


I have an Access db that is running linked tables. The tables are too
large to kick out from Access to Excel. I thought the solution should
then be, to create a form in Excel that will tell Excel to grab the
table and put it into Excel.

First I created a macro:

Sub Access_grab_test_2()
'
' Access_grab_test_2 Macro
' Macro recorded 11/2/2005 by KP_User
'

'
ChDir "F:\EAP & EDG Master Files DO NOT MOVE\TRANSPORT GENERATOR"
Workbooks.OpenDatabase Filename:= _
"F:\EAP & EDG Master Files DO NOT MOVE\TRANSPORT
GENERATOR\TRANSPORT GENERATOR.mdb" _
, CommandText:=Array("tblEAP_AMB_WEEKLY_GENERATED"),
CommandType:= _
xlCmdTable
End Sub

this creates the table, but not in Text, so then I tried:


Sub Access_grab_test()
'
' Access_grab_test Macro
' Macro recorded 11/2/2005 by KP_User
'

'
Workbooks.Add
Cells.Select
Selection.NumberFormat = "@"
Range("A1").Select
ActiveSheet.PasteSpecial Format:="Text", Link:=False,
DisplayAsIcon:= _
False
Cells.Select
Cells.EntireColumn.AutoFit
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
With Selection.Interior
ColorIndex = 15
Pattern = xlSolid
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
Selection.Borders(xlEdgeTop).LineStyle = xlNone
With Selection.Borders(xlEdgeBottom)
LineStyle = xlContinuous
Weight = xlThin
ColorIndex = xlAutomatic
End With
Selection.Borders(xlEdgeRight).LineStyle = xlNone
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Font.Bold = True
Windows("Book1").Activate
End Sub

but this won't open the db without the first bit of code. How do I
combine these so that I can open Access like the first macro, but then
have the table pull into excel text formatted?

HELP???


--
Campbellj4
------------------------------------------------------------------------
Campbellj4's Profile: http://www.excelforum.com/member.php...o&userid=28506
View this thread: http://www.excelforum.com/showthread...hreadid=481005

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
Need help with converting CUSTOM format/TEXT format to DATE format Deo Cleto Excel Worksheet Functions 6 June 2nd 09 08:14 PM
Possible to create XL file then run XL VBA (to format & filter XL file) from Access VBA? [email protected] Excel Discussion (Misc queries) 1 June 6th 08 06:37 AM
VBA Access lost after 2007 file format compatibility pack installe roanokesys Excel Discussion (Misc queries) 2 May 24th 07 11:49 AM
Time/ Number format on excel file exported from Access Joe[_3_] Excel Discussion (Misc queries) 1 April 18th 07 02:12 AM
How do you change format on Excel .CSV file to import to access Matt Excel Discussion (Misc queries) 1 January 17th 07 11:04 PM


All times are GMT +1. The time now is 12:27 AM.

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"