Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi guys.
I'm running a macro that creates a workbook with some sheets and formulas. Now I need to put some VBA code inside this new workbook, for example, an AutoOpen() macro. Can someone send me an example of how can I do it (if it is possible, at least). Thanks in advance. -------------------------------------------------------------------------------- Angelino Maneskul |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() See Chip Pearsonm's webpage 'Programming In The VBA Editor' (http://www.cpearson.com/Excel/vbe.aspx) -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=169187 Microsoft Office Help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, an example how to do : '---------------------------------------------- Sub Add_A_Sub_New_Workbook() Dim Wb As Workbook, Code As String Dim MdWb As Object, NomFeuille As String 'Write every line of you sub : Code = Code & "Sub Auto_Open()" & vbCrLf Code = Code & "ActiveWorkbook.Date1904 = False" & vbCrLf Code = Code & "ActiveWindow.WindowState = xlMaximized" & vbCrLf Code = Code & "Application.CommandBars(""Standard"").Visible =False" & vbCrLf Code = Code & "Application.CommandBars(""Formatting"").Visib le= False" & vbCrLf Code = Code & "Application.DisplayFormulaBar = False" & vbCrLf Code = Code & "Application.DisplayStatusBar = False" & vbCrLf Code = Code & "End Sub" Application.ScreenUpdating = False NomFeuille = ThisWorkbook.ActiveSheet.Name Set Wb = Workbooks.Add Set MdWb = Wb.VBProject.VBComponents.Add(1) ThisWorkbook.Sheets(NomFeuille).Activate With MdWb.CodeModule .AddFromString Code End With Set Wb = Nothing: Set MdWb = Nothing End Sub '---------------------------------------------- "Angelino Maneskul" a écrit dans le message de groupe de discussion : ... Hi guys. I'm running a macro that creates a workbook with some sheets and formulas. Now I need to put some VBA code inside this new workbook, for example, an AutoOpen() macro. Can someone send me an example of how can I do it (if it is possible, at least). Thanks in advance. -------------------------------------------------------------------------------- Angelino Maneskul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro: how to create label forms inside the worksheet not userform | Excel Programming | |||
Does Conditional Formatting create macros in my workbook? | Excel Programming | |||
Create .NET components written in C# inside Excel Macro | Excel Discussion (Misc queries) | |||
How do I refer to other macros inside a macro code? | Excel Programming | |||
Macros inside macros, and pasting into macro code. | Excel Programming |