PC Review


Reply
Thread Tools Rate Thread

Calling a VBA add in from a macro subroutine

 
 
madboy_1@hotmail.com
Guest
Posts: n/a
 
      6th Apr 2007
Hi,

dont shoot me down in flames as im a newbie I have an add in that
was kindly made by a collegue of mine It uses various functions and
has no subroutines. The add in works when you highlight a cell and
press the add in.

Im trying to make a sub routine that will call run this add in for
every cell . For some odd reason only the last cell in the list works
correctly and all the others are skipped

can anyone help ?



Range("A1").Select

Dim i As String
i = ActiveCell
If i > "" Then
Application.Run "Myprogram.xla!RALShowmetherecord()"
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      6th Apr 2007
I don't think the code was what you got working, but maybe...

Option Explicit
Sub Testme()
Dim i As String
Range("A1").Select
do
i = ActiveCell.value
If i = "" Then
exit do
end if
Application.Run "Myprogram.xla!RALShowmetherecord()"
ActiveCell.Offset(1, 0).Select
Loop
End Sub

If this doesn't work, then maybe it's not your code that has the problem--maybe
it's something in the addin's procedure?????



(E-Mail Removed) wrote:
>
> Hi,
>
> dont shoot me down in flames as im a newbie I have an add in that
> was kindly made by a collegue of mine It uses various functions and
> has no subroutines. The add in works when you highlight a cell and
> press the add in.
>
> Im trying to make a sub routine that will call run this add in for
> every cell . For some odd reason only the last cell in the list works
> correctly and all the others are skipped
>
> can anyone help ?
>
> Range("A1").Select
>
> Dim i As String
> i = ActiveCell
> If i > "" Then
> Application.Run "Myprogram.xla!RALShowmetherecord()"
> ActiveCell.Offset(1, 0).Select
> End If
> Loop
> End Sub


--

Dave Peterson
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a subroutine - how to? Roger on Excel Microsoft Excel Programming 4 8th Dec 2009 03:59 AM
Calling a Subroutine Sash Microsoft Access VBA Modules 9 18th Mar 2008 04:36 PM
Calling another subroutine sck10 Microsoft ASP .NET 3 15th Aug 2005 06:27 PM
calling subroutine Lodewijk Microsoft Access Form Coding 1 29th Mar 2005 07:31 AM
Calling a DLL subroutine =?Utf-8?B?TWFyaWFubmU=?= Microsoft VB .NET 2 15th Oct 2004 12:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:42 PM.