thisbenroberts
New member
- Local time
- Today, 08:24
- Joined
- Apr 3, 2013
- Messages
- 4
I have a number of queries in Access 2007, the results of which I have imported to a table in Excel 2007. Most days, I open the Excel file, refresh the table, and the data updates.
I created a simple public function in VBA to use in one of the queries. When I try to refresh the table, I get an error message that says " Function Undefined". The query runs fine in Access, but gives me this strange error when I update the Excel table.
To trouble-shoot it, I re-created the query without including the VBA function. Opened a new Excel file, linked the data, and had no problem at all.
Then I created the the query and included the VBA function. I opened Excel, and tried to link the data but couldn't find the query listed.
For some reason, Excel doesn't seem to like queries that use VBA functions? Has anyone else run in to this? Is there some way to resolve this issue?
Thanks
Here is the VBA function, if it matters.
I created a simple public function in VBA to use in one of the queries. When I try to refresh the table, I get an error message that says " Function Undefined". The query runs fine in Access, but gives me this strange error when I update the Excel table.
To trouble-shoot it, I re-created the query without including the VBA function. Opened a new Excel file, linked the data, and had no problem at all.
Then I created the the query and included the VBA function. I opened Excel, and tried to link the data but couldn't find the query listed.
For some reason, Excel doesn't seem to like queries that use VBA functions? Has anyone else run in to this? Is there some way to resolve this issue?
Thanks
Here is the VBA function, if it matters.
Code:
Public Function SplitString(MainStr As String, strDelimeter As String, intSpot As Integer) As String
Dim varSplit As Variant
varSplit = Split(MainStr, strDelimeter, , vbTextCompare)
SplitString = varSplit(intSpot)
End Function