L
Leo
Hi - I posted a similar message over at the 'General Questions' section and
got no reply..
I seem to be having a problem with my 'GetObject' function but i do not
think it has to do with my code as I am seeing this problem only on a
different laptop. I have checked my references on both computers and they
seem to be the same.
Here is the error: "Compile Error: Object Library feature not supported"
Here is my code:
Private Sub Import_Template()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim material_rst As DAO.Recordset
Dim process_rst As DAO.Recordset
Dim strFilter As String
Dim titlename As String
Dim xlsfile As String
Dim xlswb As Excel.Workbook
Dim xlssheet As Excel.Worksheet
Dim Activefrm As Form
Dim stDocName As String
Dim stLinkCriteria As String
Dim SetRange As Excel.Range
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim SheetCount As Integer
Dim z As Integer
Dim SheetName(50) As String
j = 1
k = 1
strFilter = ahtAddFilterItem(strFilter, "Excel File (*.xls)", "*.xls")
xlsfile = ahtCommonFileOpenSave(InitialDir:="C:\Documents and
Settings\Desktop\", _
Filter:=strFilter, FilterIndex:=1, Flags:=lngFlags, _
DialogTitle:="Please select location of Excel file...")
If xlsfile = "" Then Exit Sub
Set xlswb = GetObject(xlsfile) (this is where the error is)
Set xlssheet = xlswb.ActiveSheet
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_1804")
I would appreciate any help or advise!! Thanks!!!
got no reply..
I seem to be having a problem with my 'GetObject' function but i do not
think it has to do with my code as I am seeing this problem only on a
different laptop. I have checked my references on both computers and they
seem to be the same.
Here is the error: "Compile Error: Object Library feature not supported"
Here is my code:
Private Sub Import_Template()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim material_rst As DAO.Recordset
Dim process_rst As DAO.Recordset
Dim strFilter As String
Dim titlename As String
Dim xlsfile As String
Dim xlswb As Excel.Workbook
Dim xlssheet As Excel.Worksheet
Dim Activefrm As Form
Dim stDocName As String
Dim stLinkCriteria As String
Dim SetRange As Excel.Range
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim SheetCount As Integer
Dim z As Integer
Dim SheetName(50) As String
j = 1
k = 1
strFilter = ahtAddFilterItem(strFilter, "Excel File (*.xls)", "*.xls")
xlsfile = ahtCommonFileOpenSave(InitialDir:="C:\Documents and
Settings\Desktop\", _
Filter:=strFilter, FilterIndex:=1, Flags:=lngFlags, _
DialogTitle:="Please select location of Excel file...")
If xlsfile = "" Then Exit Sub
Set xlswb = GetObject(xlsfile) (this is where the error is)
Set xlssheet = xlswb.ActiveSheet
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_1804")
I would appreciate any help or advise!! Thanks!!!