Solved

Remove Open Workbook formula

Posted on 2011-02-21
7
231 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
  • 4
  • 3
7 Comments
 
LVL 85

Expert Comment

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

Author Comment

by:Seamus2626
Comment Utility
Sure is......
0
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

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

Author Comment

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

Accepted Solution

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

Author Closing Comment

by:Seamus2626
Comment Utility
Sorted, thanks!!

Seamus
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now