Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Run-time error '1004', the macro xxx cannot be found.

I'm calling Excel from Access to run a lengthy report. In order to
ensure I have the correct modules loaded up, I call them explicitly:

Set oExcelApp = GetObject(, "Excel.Application")
If Err < 0 Then
Set oExcelApp = CreateObject("Excel.Application")
bStarted = True
End If

' make sure that Pricing is open and up to date
If oExcelApp.Workbooks.Count = 0 Or
Len(oExcelApp.Workbooks("Pricing.xla").name) < 0 Then
ret = oExcelApp.Workbooks.Open("O:\HPL\Addins\Pricing.xl a")
End If

oExcelApp.Visible = True
ret = oExcelApp.Run("HPLCreate.xla!BuildHPL",)

This is returning the error in the subject, 1004. The app is visible,
so I go over, view VBA, and sure enough, the module is absolutely
there. Yes, it's public.

Does anyone have a clue why this might be happening?

Maury
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Run-time error '1004', the macro xxx cannot be found.

It looks to me like you're trying to run a macro from a different add in that
the one you loaded.
--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"Maury Markowitz" wrote:

I'm calling Excel from Access to run a lengthy report. In order to
ensure I have the correct modules loaded up, I call them explicitly:

Set oExcelApp = GetObject(, "Excel.Application")
If Err < 0 Then
Set oExcelApp = CreateObject("Excel.Application")
bStarted = True
End If

' make sure that Pricing is open and up to date
If oExcelApp.Workbooks.Count = 0 Or
Len(oExcelApp.Workbooks("Pricing.xla").name) < 0 Then
ret = oExcelApp.Workbooks.Open("O:\HPL\Addins\Pricing.xl a")
End If

oExcelApp.Visible = True
ret = oExcelApp.Run("HPLCreate.xla!BuildHPL",)

This is returning the error in the subject, 1004. The app is visible,
so I go over, view VBA, and sure enough, the module is absolutely
there. Yes, it's public.

Does anyone have a clue why this might be happening?

Maury

Reply
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
Run-Time error '1004': No cells were found Regina[_2_] Excel Programming 13 November 28th 06 08:59 PM
Run time error 1004: "No list was found.." hachiroku[_5_] Excel Programming 1 May 22nd 06 12:53 PM
Microsoft Visual Basic Run-time error '1004' No cells were found Paul Riker Excel Programming 8 July 28th 05 05:53 AM
Run-time error '1004': No cells were found Jamie Excel Programming 0 May 16th 05 11:01 PM
Run-time error '1004': No cells were found Jamie Excel Programming 0 May 16th 05 10:52 PM


All times are GMT +1. The time now is 04:02 AM.

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

About Us

"It's about Microsoft Excel"