![]() |
Create Excel Macros
Dear All,
I am new to excel Programming.I have some (set of)basic doubts which may irritate you people.Please excuse me. 1.Where excel macros will be stored? 2.Is it possible to write a macro (common )which all excel files can use. 3.I have an excel macro which Macro's text will be stored in SQL database.Wat i need is to run the macro in an excel sheet programatically.(I am using C#).I will select the macro name and corresponding text will be displayed in a richtextbox.When i say run macro,an excel files should open and run the macro.All should be done automatically. 4.How to find an excel sheet is BLANK programtically? Please let me know if i am not clear. Expecting some advise/guidance with some sample code.Thanks in advance. Regards, V ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Create Excel Macros
vipinsasi wrote in message ... Dear All, I am new to excel Programming.I have some (set of)basic doubts which may irritate you people.Please excuse me. 1.Where excel macros will be stored? In a workbook 2.Is it possible to write a macro (common )which all excel files can use. If the workbook is open and the sub is public, then any other open workbook can execute the macro using the Run command. If you create a reference to the workbook containing the macro, then you can run it as if it were stored in the calling workbook. A common practice is to put the macro in an Addin. If the addin is selected by the user, then it will be open when excel is opened manually. It will not be opened if excel is opened with code. 3.I have an excel macro which Macro's text will be stored in SQL database.Wat i need is to run the macro in an excel sheet programatically.(I am using C#).I will select the macro name and corresponding text will be displayed in a richtextbox.When i say run macro,an excel files should open and run the macro.All should be done automatically. You would have to transfer the string that constitutes the macro's code to a module in Excel and then execute it, however, you can control Excel using Automation directly from C#, so you proposed approach appears to be the long way around the block. For working with the VBE with code http://www.cpearson.com/excel/vbe.htm See below for links to code samples 4.How to find an excel sheet is BLANK programtically? in VBA If Activesheet.UsedRange.count = 1 and isempty(range("A1")) then ' the sheet is blank and has no special formatting applied. End if Please let me know if i am not clear. Expecting some advise/guidance with some sample code.Thanks in advance. Regards, V Here is a good overview article: (it has a lot of links as well, some of which may be duplicated below) http://support.microsoft.com/default...&Product=vcSne t INFO: Develop Microsoft Office Solutions with Visual Studio .NET Here are some code samples in C#: http://support.microsoft.com/default...&Product=vcSne t HOWTO: Automate Excel with Visual C# .NET to Fill or to Obtain Data in a Range by Using Arrays http://support.microsoft.com/default...&Product=vcSne t HOWTO: Create an Excel Macro by Using Automation from Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOWTO: Automate Microsoft Excel from Microsoft Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Handle Events for Excel by Using Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Handle Events for Excel by Using Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Transfer XML Data to Microsoft Excel 2002 by Using Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOWTO: Use Automation to Create Office Command Bars and Controls with Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t PRB: Office Application Does Not Quit After Automation from Visual Studio ..NET Client http://support.microsoft.com/default...&Product=vcSne t HOW TO: Transfer Data to an Excel Workbook by Using Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Check the Type of a COM Object (System.__ComObject) with Visual C# ..NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Use ASP.NET to Query and Display Database Data in Excel by Using Visual C# .NET http://support.microsoft.com/default...&Product=vcSne t HOW TO: Retrieve Meta Data from Excel by Using GetOleDbSchemaTable in Visual C# .NET -- Regards, Tom Ogilvy |
Create Excel Macros
Dear Mr.Tom Ogilvy,
Nice Explanation ..Thanks a lot!....Mr.Excel Cheers! V ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
All times are GMT +1. The time now is 05:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com