Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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
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
Crazy If LiveUser Excel Worksheet Functions 1 January 30th 08 02:44 PM
Going Crazy Beep Beep Excel Programming 5 June 22nd 07 07:28 PM
I'm going crazy here famdamly Excel Discussion (Misc queries) 2 December 9th 05 06:15 PM
This is crazy!!! Chris Excel Discussion (Misc queries) 1 August 10th 05 05:06 PM
ADO SQL: Im getting CRAZY VladimirM Excel Programming 4 July 8th 05 11:21 AM


All times are GMT +1. The time now is 12:55 PM.

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"