Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default how to add a macro

Hi, all:

Could you tell me how to insert a macro to excel externally, i.e. from an
external language that uses automation from Excel?

I need to run the macro from inside Excel, rather than the External language.

So, from the external language (vb6 or .net) I would call the Application
object and run the macro, which is in Excel.

For instance, I want to have the folowing code inside Excel:

Sub Auto_open()
... Some Code
End Sub

How can I Include it before Excel opens?

Thank you,

Rick.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to add a macro

http://www.cpearson.com/excel/vbe.htm

shows you how to program the VBE. If using xl2002 or later, the user would
have to trust access to the VBE in their security settings. You wouldn't be
able to open a file, then put in an autoopen macro and expect it to run at
that time. However, there is no reason you can't run it with your code after
it is created.

http://support.microsoft.com/?id=177760

----------

http://support.microsoft.com/?id=219151
Q219151 - HOWTO: Automate Excel 97 and Excel 2000 from Visual Basic

http://support.microsoft.com/?id=167223
Microsoft Office 97 Automation Help File Available on MSL


--
Regards,
Tom Ogilvy



"newbie in hell" wrote:

Hi, all:

Could you tell me how to insert a macro to excel externally, i.e. from an
external language that uses automation from Excel?

I need to run the macro from inside Excel, rather than the External language.

So, from the external language (vb6 or .net) I would call the Application
object and run the macro, which is in Excel.

For instance, I want to have the folowing code inside Excel:

Sub Auto_open()
... Some Code
End Sub

How can I Include it before Excel opens?

Thank you,

Rick.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default how to add a macro

Hi Rick,

See Chip Pearson's at:

Programming To The Visual Basic
http://www.cpearson.com/excel/vbe.htm



---
Regards,
Norman




"newbie in hell" wrote in message
...
Hi, all:

Could you tell me how to insert a macro to excel externally, i.e. from an
external language that uses automation from Excel?

I need to run the macro from inside Excel, rather than the External
language.

So, from the external language (vb6 or .net) I would call the Application
object and run the macro, which is in Excel.

For instance, I want to have the folowing code inside Excel:

Sub Auto_open()
... Some Code
End Sub

How can I Include it before Excel opens?

Thank you,

Rick.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default how to add a macro

Thank you.

What I need is to create a macro programmatically (from the other language).


Rick.

"Norman Jones" wrote:

Hi Rick,

See Chip Pearson's at:

Programming To The Visual Basic
http://www.cpearson.com/excel/vbe.htm



---
Regards,
Norman




"newbie in hell" wrote in message
...
Hi, all:

Could you tell me how to insert a macro to excel externally, i.e. from an
external language that uses automation from Excel?

I need to run the macro from inside Excel, rather than the External
language.

So, from the external language (vb6 or .net) I would call the Application
object and run the macro, which is in Excel.

For instance, I want to have the folowing code inside Excel:

Sub Auto_open()
... Some Code
End Sub

How can I Include it before Excel opens?

Thank you,

Rick.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to add a macro


And that link and the links I provided show you how.

--
Regards,
Tom Ogilvy


"newbie in hell" wrote:

Thank you.

What I need is to create a macro programmatically (from the other language).


Rick.

"Norman Jones" wrote:

Hi Rick,

See Chip Pearson's at:

Programming To The Visual Basic
http://www.cpearson.com/excel/vbe.htm



---
Regards,
Norman




"newbie in hell" wrote in message
...
Hi, all:

Could you tell me how to insert a macro to excel externally, i.e. from an
external language that uses automation from Excel?

I need to run the macro from inside Excel, rather than the External
language.

So, from the external language (vb6 or .net) I would call the Application
object and run the macro, which is in Excel.

For instance, I want to have the folowing code inside Excel:

Sub Auto_open()
... Some Code
End Sub

How can I Include it before Excel opens?

Thank you,

Rick.




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
Macro recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor [email protected] Excel Programming 2 March 30th 07 07:48 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM
Start Macro / Stop Macro / Restart Macro Pete[_13_] Excel Programming 2 November 21st 03 05:04 PM


All times are GMT +1. The time now is 09:40 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"