Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with a macro
I have a strange problem with some macros in Excel 2000.
The macros are all run from buttons on the same worksheet. Thi worksheet allows the user to select a client name from a drop-dow list, then builds a path/filename based on that selection. Once the path/filename is built, the user can press another button t actually load a file into Excel (it is an excel workbook). This macr uses the code "Workbooks.Open m_file" to load the workbook, wher m_file contains the path/filename generated earlier. This part work fine. Once the file is loaded, there is another button which runs a macro t compare a list of names in the current workbook against a master lis in another workbook. If there are names to be added, the macro insert a row in the proper place and copys the information from the maste list. I am using "Selection.EntireRow.Insert" to insert the row (th currently selected row is at the position where I want the ro inserted). This code causes a memory access violation and crashes Excel, bu here's the strange part. This crash happens *only* if the file wa loaded by clicking the "load" button mentioned earlier. If the user selects the client name from the list (so the filename get built), but then goes out and loads the file manually without clickin the "Load file" button, then when the "Update Rows" button is clicked there is no crash. The macro works fine and inserts rows as needed often multiple times in the same run. Running the Update macro afte the file has been loaded by clicking the Load button results in a fata crash every single time the EntireRow.Insert code fires. Anyone have any ideas why this could be happening -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Problem | New Users to Excel | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Worksheet Functions | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Discussion (Misc queries) | |||
Macro problem | Excel Worksheet Functions | |||
macro problem | Excel Discussion (Misc queries) |