ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to execute macro from vb 6.0 code? (https://www.excelbanter.com/excel-programming/341441-how-execute-macro-vbulletin-6-0-code.html)

B Deepak

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



Tom Ogilvy

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





B Deepak

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







Tom Ogilvy

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









B Deepak

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








All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com