Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All, Here is my code for transfering data from access form to excel sheet.
But I am getting this error "object doesnt support this property or method" on: With xl ..Range("City").Value = Me.City.Value '.Range("A3").Value = Me.City.Value End With Here is the whole code: Private Sub ExportToExcel_Click() Dim exApp As Object Dim xl As Object Dim fdialog As FileDialog Dim pathAndFile As String Dim filePath As String Dim shortName As String filePath = "C:\My Documents\Sheet.xls" Set exApp = GetObject(, "Excel.Application") If Err.Number < 0 Then Set exApp = CreateObject("Excel.Application") End If On Error GoTo 0 exApp.Visible = True Dim FName As String Set fdialog = exApp.FileDialog(msoFileDialogFilePicker) With fdialog .AllowMultiSelect = False .Filters.Clear .InitialFileName = filePath & "\*.xls*" If .Show Then pathAndFile = .SelectedItems(1) shortName = Right(pathAndFile, _ Len(pathAndFile) - InStrRev(pathAndFile, "\")) Else MsgBox "User cancelled. Did not select a file" GoTo PastCode End If End With Set fdialog = Nothing Set xl = exApp.Workbooks.Open(pathAndFile) With xl ..Range("City").Value = Me.City.Value '.Range("A3").Value = Me.City.Value End With exApp.Quit Set xl = Nothing Set exApp = Nothing End Sub Thanks in advance |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error 434, object does not support this method or property | Excel Discussion (Misc queries) | |||
Object doesn't support this property or method (Error 438) | Excel Programming | |||
help with my code please. (Error: Object doesn't support this property or method) | Excel Programming | |||
Object doesn't support this property or method (Error 438) | Excel Discussion (Misc queries) | |||
Run Time Error 438 - Object doesn't support the property or method | Excel Programming |