Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default how to execute macro from vb 6.0 code?

Hi All,

I have a macro which will take string array as input and ll display it into
the excel sheet. But I dont know how to call it frm vb application?
Please help me for the same.

Thanks n Regards,
Deepak


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to execute macro from vb 6.0 code?

these both worked for me from within Excel:

Sub Main()
Dim vArray As Variant
vArray = Range("A1:B10")
Application.Run "Macro1", vArray
End Sub

Sub tester()
Dim vArray As Variant
vArray = Range("A1:B10")
Macro1 vArray
End Sub

Sub Macro1(v As Variant)
Debug.Print LBound(v, 1), UBound(v, 1)
Debug.Print LBound(v, 2), UBound(v, 2)
Debug.Print v(UBound(v, 1), UBound(v, 2))
End Sub

I don't know whether you don't know about RUN or you are saying it doesn't
work with an array using automation.

--
Regards,
Tom Ogilvy



"B Deepak" wrote in message
...
Hi All,

I have a macro which will take string array as input and ll display it

into
the excel sheet. But I dont know how to call it frm vb application?
Please help me for the same.

Thanks n Regards,
Deepak




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default how to execute macro from vb 6.0 code?

Can u plse provide me sample VB application for doin this?
I m new to vb :). Please do the needful.

Thanks,
Deepak

"Tom Ogilvy" wrote in message
...
these both worked for me from within Excel:

Sub Main()
Dim vArray As Variant
vArray = Range("A1:B10")
Application.Run "Macro1", vArray
End Sub

Sub tester()
Dim vArray As Variant
vArray = Range("A1:B10")
Macro1 vArray
End Sub

Sub Macro1(v As Variant)
Debug.Print LBound(v, 1), UBound(v, 1)
Debug.Print LBound(v, 2), UBound(v, 2)
Debug.Print v(UBound(v, 1), UBound(v, 2))
End Sub

I don't know whether you don't know about RUN or you are saying it doesn't
work with an array using automation.

--
Regards,
Tom Ogilvy



"B Deepak" wrote in message
...
Hi All,

I have a macro which will take string array as input and ll display it

into
the excel sheet. But I dont know how to call it frm vb application?
Please help me for the same.

Thanks n Regards,
Deepak






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to execute macro from vb 6.0 code?

I am posting in an Excel group. While there may be many here who have VB6
installed, I am not one of them.

--
Regards,
Tom Ogilvy


"B Deepak" wrote in message
...
Can u plse provide me sample VB application for doin this?
I m new to vb :). Please do the needful.

Thanks,
Deepak

"Tom Ogilvy" wrote in message
...
these both worked for me from within Excel:

Sub Main()
Dim vArray As Variant
vArray = Range("A1:B10")
Application.Run "Macro1", vArray
End Sub

Sub tester()
Dim vArray As Variant
vArray = Range("A1:B10")
Macro1 vArray
End Sub

Sub Macro1(v As Variant)
Debug.Print LBound(v, 1), UBound(v, 1)
Debug.Print LBound(v, 2), UBound(v, 2)
Debug.Print v(UBound(v, 1), UBound(v, 2))
End Sub

I don't know whether you don't know about RUN or you are saying it

doesn't
work with an array using automation.

--
Regards,
Tom Ogilvy



"B Deepak" wrote in message
...
Hi All,

I have a macro which will take string array as input and ll display it

into
the excel sheet. But I dont know how to call it frm vb application?
Please help me for the same.

Thanks n Regards,
Deepak








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default how to execute macro from vb 6.0 code?

Hi TOm,

Can u plse give me the sample code which will execute macro from vb
application?

Thanks,
Deepak
"Tom Ogilvy" wrote in message
...
these both worked for me from within Excel:

Sub Main()
Dim vArray As Variant
vArray = Range("A1:B10")
Application.Run "Macro1", vArray
End Sub

Sub tester()
Dim vArray As Variant
vArray = Range("A1:B10")
Macro1 vArray
End Sub

Sub Macro1(v As Variant)
Debug.Print LBound(v, 1), UBound(v, 1)
Debug.Print LBound(v, 2), UBound(v, 2)
Debug.Print v(UBound(v, 1), UBound(v, 2))
End Sub

I don't know whether you don't know about RUN or you are saying it doesn't
work with an array using automation.

--
Regards,
Tom Ogilvy



"B Deepak" wrote in message
...
Hi All,

I have a macro which will take string array as input and ll display it

into
the excel sheet. But I dont know how to call it frm vb application?
Please help me for the same.

Thanks n Regards,
Deepak








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
Code won't execute... Jim Cone Excel Programming 1 August 20th 05 07:22 AM
Execute code on server Steph[_3_] Excel Programming 3 March 28th 05 06:44 PM
Why does this code take so long to execute. John Keith[_2_] Excel Programming 4 March 6th 05 07:44 PM
When does Code Execute on a List Box? John Baker Excel Programming 0 January 11th 05 08:24 PM
execute code for all 12 months Herb Buist Excel Programming 0 July 19th 03 03:43 PM


All times are GMT +1. The time now is 09:17 AM.

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"