LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Problem John Calder New Users to Excel 1 June 2nd 09 02:06 AM
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 Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
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 Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Macro problem tweacle Excel Worksheet Functions 0 February 15th 06 08:26 PM
macro problem Kevin Excel Discussion (Misc queries) 1 December 14th 04 10:47 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"