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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel > Access

Status
Not open for further replies.

TidyTrax

Programmer
Jul 11, 2001
263
AU
I have just recently returned to the application programming scene after two years in a support role, so im a little rusty.

What i am creating is a database application, im looking for an example of some code. What i have is a series of excel files that are created each month, each file has a template that never changes and unique naming convention. Now what i want to do is simply through access vba is to grab the data from each of these spreadsheets and automatically update the database. Any pointers would be very greatly appreciated!

Thanks

M
 
This is the standard way I open excel workbooks from access.....
Option Compare Database

Option Explicit
Sub OpenExcel()

Dim objExcelApp As New Excel.Application
Dim objExcel As Object
'create Excel
Set objExcelApp = New Excel.Application
'open file
Set objExcel = objExcelApp.Workbooks.Open("D:\booknew.xls")
objExcelApp.Visible = True

You can create a variable and substitute it for the path / name of the workbook eg
Workbooks.open(myPath & myFileName & myDate & ".xls")

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top