hi...
i have an access application in which i need to open an existing excel sheet, find a date (already in the sheet) and populate a row (with the date cell column) with either 1 or 0
this means i have to convert the datecell.column to the alphabet equivalent before i can set a cell to be populated.
I used a function, which i have used in excel before (as seen below)
when called, this runs fine on first run, gives an error (Method 'Cells' of Object' _Global' failed) the second run, runs fine the third run, and gives same error the fourth run...etc
i have tried more explicit methods of referring to the cell... seeing as i am working with excel from assess, but non has worked.
i tried
(these act in a similar way to the first issue)
(this returns an object required error)
Any idea what i doing wrong?
i have an access application in which i need to open an existing excel sheet, find a date (already in the sheet) and populate a row (with the date cell column) with either 1 or 0
this means i have to convert the datecell.column to the alphabet equivalent before i can set a cell to be populated.
I used a function, which i have used in excel before (as seen below)
Code:
Function Col_Letter(lngcol) As String Dim vArr vArr = Split(Cells(1, lngcol).Address(True, False), "$") Col_Letter = vArr(0) End Function
i have tried more explicit methods of referring to the cell... seeing as i am working with excel from assess, but non has worked.
i tried
Code:
Function Col_Letter(lngcol) As String
Dim vArr
With Worksheets("August2013")
vArr = Split(Cells(1, lngcol).Address(True, False), "$")
Col_Letter = vArr(0)
End With
End Function
Code:
Function Col_Letter(lngcol) As String Dim vArr With Worksheets(1) vArr = Split(Cells(1, lngcol).Address(True, False), "$") Col_Letter = vArr(0) End With End Function
Code:
Function Col_Letter(lngcol) As String Dim vArr With Sheets(1) vArr = Split(Cells(1, lngcol).Address(True, False), "$") Col_Letter = vArr(0) End With End Function
Code:
Function Col_Letter(lngcol) As String Dim vArr vArr = Split(Sheets(1).Cells(1, lngcol).Address(True, False), "$") Col_Letter = vArr(0) End Function
Code:
Function Col_Letter(lngcol) As String
Dim vArr
Dim app As New Excel.Application
app.Visible = True
Dim Book As Excel.Workbook
Set Book = app.Workbooks.Add("D:\...\timesheeteng.xlsm")
With Book.Worksheets("August2013")
vArr = Split(Cells(1, lngcol).Address(True, False), "$")
Col_Letter = vArr(0)
End With
End Function
Any idea what i doing wrong?
Comment