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. |
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. |
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. |
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. |
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. |
All times are GMT +1. The time now is 08:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com