Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error - Replace command within access acting on excel file
Hello,
MS ACCESS/EXCEL 2003 on XP PRO. I am writing code in ACCESS to format an excel document exported from the access file. I have an error. v_look_for = "3 (i.e. all week-end)" v_replace_with = 3 .Selection.Replace What:=v_look_for, Replacement:=v_replace_with, _ LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False This returns an error <<<Run-time error '9': subscript out of range The error occurs on the .selection line It's not a TYPE issue because I have tried to make v_replace_with="3" as well and it doesn't work. The range in excel that I have selected DEFINITELY has exactly v_look_for in it. The rest of my code for embedding excel vba in access is working. and here's my setup. Set obj_excel = CreateObject("Excel.Application") obj_excel.Visible = True obj_excel.DisplayAlerts = False Dim str_target As String, row_count As Long, str_target_col As String, lcv As Long With obj_excel 'do all sorts of excel stuff end with Any idea what's dying? Excel help says it's an array problem, but there's no dimmed array to kill. Thanks! -- BlueWolverine MSE - Mech. Eng. Go BLUE! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File access error in Excel | Excel Discussion (Misc queries) | |||
Excel file acting odd | Excel Discussion (Misc queries) | |||
how can I access favorites in the Excel 2007 Open file command | Excel Discussion (Misc queries) | |||
how can I access favorites in the Excel 2007 Open file command | Setting up and Configuration of Excel | |||
When opening Excel - get Access (Read-Only) file and error | Setting up and Configuration of Excel |