Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating fields heading

Status
Not open for further replies.

coughnut

Programmer
Dec 6, 2005
27
US
Hi, I am using VBA to import an Excel worksheet to Acess, and I would like to create a table with fields located in different cells in the worksheet. Is this possible, and if so can anyone be of some of help. thanks...
 
You can try using DDE to both send and get data ... this example sends data to Excel --

Private Sub XLS_TOOL(XLSFILE As String)
Shell "C:\Program Files\Microsoft Office\Office\excel.exe" & _
" " & Chr(34) & _
XLSFILE & _
Chr(34), vbMaximizedFocus
DoEvents
Me.CURRENT_PATH.ControlSource = _
"=ddesend('Excel','AGA_DATA','AGA_PATH'," & Chr(34) & _
Application.CurrentProject.Path & Chr(34) & ")"
Me.CURRENT_MDB.ControlSource = _
"=ddesend('Excel','AGA_DATA','AGA_MDB'," & Chr(34) & _
Application.CurrentProject.Name & Chr(34) & ")"
End Sub

--- Check the Help file ... you can also pull data from specific ranges. My real suggestion, however, would be to do some programming in Excel to create either a new workbook or a new "DATA" tab that's a little more ammeniable to importing into Acess. I've found DDE to be a mess to get to work in corporate environments due to everyone having different security settings, patches, etc. It's ugly stuff and nobody understands DDE (not even MicroSoft) ;-)


Alan J. Volkert
Fleet Services
GE Commercial Finance Capital Solutions
(World's longest company title)
Eden Prairie, MN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top