1004 Run-time error  
Author Message
deltree





PostPosted: Visual Basic for Applications (VBA), 1004 Run-time error Top

I tried doing a search for this error message, but couldn't find one related to my problem, so here goes.

Running Excel 2000 here and this macro (snippet below) has been running fine on several machines. Suddenly, this one machine in particular has been getting a 1004 Run-time error (With statement).

I have an idea what the problem is, but the thing that gets me is this code still successfully works on several other machines at my work place.

I know the code is sloppy, as you'll see below. I'm simply trying to fix something that was already in place before I got here. I'll definitely clean it up once I get it working.

Any ideas Thanks in advance for the help.

--------------------------------------------

Sub maketable()

Application.DisplayAlerts = False
Application.ScreenUpdating = False

DirPathVars

Workbooks.Add
With Application
.DefaultFilePath = DPTH1 & DPTH11
.SheetsInNewWorkbook = 1
Cells.Select
.StandardFont = "Century Schoolbook"
.StandardFontSize = 8
Selection.ColumnWidth = 2
Selection.RowHeight = 13 '13

End With

....



Microsoft ISV Community Center Forums2  
 
 
deltree





PostPosted: Visual Basic for Applications (VBA), 1004 Run-time error Top

Something additional I noticed on the problem machine. When I click on Options in the Tools menu, nothing shows up.
 
 
Derek Smyth





PostPosted: Visual Basic for Applications (VBA), 1004 Run-time error Top

Hi,

Thats a classic scenario for a missing reference or even a COM versioning problem. On the machine with the error, open the workbook, goto the Macro Editor and do Tools->References, check the list of items there and see if anything is missing or referencing an older or more recent file.

Thats a good place to start.

.



 
 
deltree





PostPosted: Visual Basic for Applications (VBA), 1004 Run-time error Top

What I actually did was go into the registry and compare the settings which apparently didn't match in certain areas.  After altering a few values, everything ran smooth.

Just FYI, if it matters
HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel\Options

"Options" didn't match and "Asst In Wizard" was missing among a few others.

Thanks for the help all.