mkasson
Programmer
- Jan 3, 2004
- 36
Developing an Access app using VBA. There is an Excel spreadsheet which I am opening for a more detailed analysis of the selected record. (No problem opening Excel.) After opening Excel, I would like to be able to call a procedure in the Excel file's code module. (I am passing the index key to the Excel procedure so it can look things up.)
I imagine its a simple tweak from what I've got:
In a procedure in my Access Form's Module:
--------------------------------------------------------------------------------
In my Excel ThisWorkbook Module:
--------------------------------------------------------------------------------
I don't do any declaring or 'Public'ing. (Tried Public to no avail.)
Any help would be greatly appreciated.
- MSK
I imagine its a simple tweak from what I've got:
In a procedure in my Access Form's Module:
Code:
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Workbooks.Open (CurrentProject.Path + "\LienDb.xls")
oApp.Load1Lien (Form!LienKey) 'THE PROBLEM
--------------------------------------------------------------------------------
In my Excel ThisWorkbook Module:
Code:
Sub Load1Lien(LienNum As Integer)
' ... load the data relating to LienNum
End Sub
--------------------------------------------------------------------------------
I don't do any declaring or 'Public'ing. (Tried Public to no avail.)
Any help would be greatly appreciated.
- MSK