On Nov 7, 4:00 am, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
Quote:
On Tue, 06 Nov 2007 16:58:45 -0800, oliver james
>
<oliverja...@mailinator.comwrote:
>
That's right. Change the event procedure from Private to Public, then
call it like any other public procedure.
>
-Tom.
>
I'm struggling to call a public procedure in a standard module in
Excel from Access, can anyone tell me why the following code does not
work?
In the Excel spreadsheet I have declared the following public function
in a standard module 'PubFns':
Public Function pubintTest()
pubintTest = 100
End Function
In an Access database I have the following subroutine:
Public Sub pubsubRunProc()
Dim xlapp As Excel.Application
Dim xlwkb As Excel.Workbook
Dim intX As Integer
Set xlapp = New Excel.Application
xlapp.Visible = True
Set xlwkb = xlapp.Workbooks.Open("C:\Test1.xls")
intX = xlapp.pubintTest
Debug.Print intX
End Sub
When I run pubsubRunProc from the Immediate window the spreadsheet
opens but I get the error message: "Run-time error '438' Object
doesn't support this property or method"
Any assistance would be appreciated.
Cheers,
Oliver