Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I'm getting crazy
I copy this code from Peters page but Excell always get crash when try to
create de module. I learned that it happens because It tries to compile the module when in running mode. So is it? One cant put this cod to work? Oh: It is one Workbook creating code in another Workbook Tks for any help Sub CreateEventProcedure(Mnew) €˜Mnew is the new workbook Dim VBProj As VBIDE.VBProject Dim VBComp As VBIDE.VBComponent Dim CodeMod As VBIDE.CodeModule Dim LineNum As Long Set VBProj = Mnew.VBProject Set VBComp = VBProj.VBComponents("EstaPasta_de_trabalho") Set CodeMod = VBComp.CodeModule With CodeMod LineNum = .CreateEventProc("Open", "Workbook") LineNum = LineNum + 1 .InsertLines LineNum, "Application.Calculation = xlCalculationAutomatic " LineNum = LineNum + 1 .InsertLines LineNum, "ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources" LineNum = LineNum + 1 .InsertLines LineNum, "Application.Visible = False" LineNum = LineNum + 1 .InsertLines LineNum, "Inputs1.show" LineNum = LineNum + 1 .InsertLines LineNum, "Application.Visible = true" End With Worksheets(1).Activate -- Peres |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Crazy If | Excel Worksheet Functions | |||
Going Crazy | Excel Programming | |||
I'm going crazy here | Excel Discussion (Misc queries) | |||
This is crazy!!! | Excel Discussion (Misc queries) | |||
ADO SQL: Im getting CRAZY | Excel Programming |