Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time Error '1004'
Hi,
I have a simple function (below) that generates the following message "Run-time Error '1004': Application-defined or object-defined error". Any ideas on what I am doing wrong? Thanks tons! Public Sub Workbook_Open() Application.VBE.ActiveVBProject.VBComponents.Item( "Module1").CodeModule.ReplaceLine 1, "TEST LINE" End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time Error '1004'
On Oct 13, 10:11 pm, BigBrother
wrote: Hi, I have a simple function (below) that generates the following message "Run-time Error '1004': Application-defined or object-defined error". Any ideas on what I am doing wrong? Thanks tons! Public Sub Workbook_Open() Application.VBE.ActiveVBProject.VBComponents.Item( "Module1").CodeModule.ReplaceLine 1, "TEST LINE" End Sub Hello BigBrother, Have you set a reference in your VBA project to the Microsoft Extensibility for Visual Basic? I tried several ways to reproduce your error, but was unable. I tried no reference to the VBIDE in the project, no module, and no prior code in the module. Error 1004 never came up. Sorry I couldn't be more help. Sincerely, Leith Ross |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time Error '1004'
The first thing I would look at is whether the "Trust access to the VB
project" setting is checked. Go to the Tools menu, Macros, Security, Trusted Publisher, and check "Trust Access To Visual Basic Project". -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "BigBrother" wrote in message ... Hi, I have a simple function (below) that generates the following message "Run-time Error '1004': Application-defined or object-defined error". Any ideas on what I am doing wrong? Thanks tons! Public Sub Workbook_Open() Application.VBE.ActiveVBProject.VBComponents.Item( "Module1").CodeModule.ReplaceLine 1, "TEST LINE" End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time Error '1004'
Chip.
This worked! Thanks a lot!!! "Chip Pearson" wrote: The first thing I would look at is whether the "Trust access to the VB project" setting is checked. Go to the Tools menu, Macros, Security, Trusted Publisher, and check "Trust Access To Visual Basic Project". -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "BigBrother" wrote in message ... Hi, I have a simple function (below) that generates the following message "Run-time Error '1004': Application-defined or object-defined error". Any ideas on what I am doing wrong? Thanks tons! Public Sub Workbook_Open() Application.VBE.ActiveVBProject.VBComponents.Item( "Module1").CodeModule.ReplaceLine 1, "TEST LINE" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming |