Solved

Remove Open Workbook formula

Posted on 2011-02-21
7
235 Views
Last Modified: 2012-05-11
Hi,

Im looking for a piece of code that i could assign a macro too which can remove some another piece of code.

So i have a report that turns from a master file to a dated file (via a macro button) e.g. MasterReport.xls to 18/02/2010.

Once changed to the date file, i want to remove this piece of code in the open workbook

Private Sub Workbook_Open()
AllWorkbookPivots
End Sub


What piece of code could i use to remove that code!

Thanks
Seamus
0
Comment
Question by:Seamus2626
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34944419
Is that the only code in the ThisWorkbook module of the workbook?
0
 

Author Comment

by:Seamus2626
ID: 34944433
Sure is......
0
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 34944503
With Workbooks("blah.xls").VBProject.VBComponents("ThisWorkbook").Codemodule
   .DeleteLines 1, .CountOfLines
End With

Open in new window


You need to have access to the VBProject trusted.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:Seamus2626
ID: 34944545
Hey Rory, got the attached error message on running this
Doc1.doc
0
 

Author Comment

by:Seamus2626
ID: 34944601
Sorry Rory, just seen the bottom part of your response.....
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 34944608
Do you have access to the VBProject trusted?
0
 

Author Closing Comment

by:Seamus2626
ID: 34944628
Sorted, thanks!!

Seamus
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question