NiceMan331
Registered User.
- Local time
- Today, 17:32
- Joined
- Apr 23, 2008
- Messages
- 15
hi
i have AN access database ,which in one part of it will analyse a big amount of data with excell sheet format
i am using this code to import the sheet to my database
when trying to perform this code , it gives an error message that object do'snt in corect format , then i go to that workbook , save it as excell 97-2000 , then performing the code again , it success .
the problem is the big number of workbooks , it is so difficult to open it one by one , save as , repaet it every time ,
i tried this code to perform automatic open and save as , but it fail
but it break at save as point , it said this proberty not allowed here
any idea ?
i have AN access database ,which in one part of it will analyse a big amount of data with excell sheet format
i am using this code to import the sheet to my database
Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Calls", "d:\My Documents\myfile.xls", True, "details!b1:h1068"
the problem is the big number of workbooks , it is so difficult to open it one by one , save as , repaet it every time ,
i tried this code to perform automatic open and save as , but it fail
Code:
Sub OpenSpecific_xlFile()
Dim oXL As Object
Dim oExcel As Object
Dim sFullPath As String
Dim sPath As String
Set oXL = CreateObject("Excel.Application")
On Error Resume Next
oXL.UserControl = True
On Error GoTo 0
On Error GoTo ErrHandle
sFullPath = CurrentProject.Path & "\myfile.xls"
With oXL
.Visible = True
.workbooks.Open (sFullPath)
.workbooks.SaveAs FileName:=(sFullPath), FileFormat:=56
End With
ErrExit:
Set oXL = Nothing
Exit Sub
ErrHandle:
oXL.Visible = False
MsgBox Err.Description
GoTo ErrExit
End Sub
but it break at save as point , it said this proberty not allowed here
any idea ?