excel vba open
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Excel VBA - Open sheet within current workbook

Excel VBA - Open sheet within current workbook

resolvedResolved · High Priority · Version 2003

replyReplyMon 26 Jul 2010, 14:20Delegate Ziggy said...

Excel VBA - Open sheet within current workbook

Good Afternoon

I was told during the VBA Advanced course today that my query was a simple one and if I posted it on here someone would get back to me.

The problem is as follows:

Following the Intro VBA course I developed a great application for my company - works like a charm. This application needs to be applied to about 80% of the company's work-load. Now I could of course place the code into EACH of the workbooks, however I would prefer to treat this application almost like a bespoke piece of software - opening workbooks within the application, editing them, doing whatever, saving them, and then leaving the application workbook unchanged.

So I would like to add a bit of code that;
- opens up the window one sees if they select "Open File" in excel/microsoft generally, allowing me to therefore navigate and select a file.
- On open "pulls" two sheets (always labeled the same, "sheet1" and "sheet2", will do for an example) into the open application wookbook - thus allowing the rest of the application to perform its task.
- On save, saves any changes to the two worksheets back to the original file from which they came.


I already have a custom save routine running in the application workbook in order to "force" macro enable on open, so I can probably work out the save component of this request if an example of the first two elements is offered.

If someone could offer a solution to this I would be very grateful. If only beacuse it will reduce the need to maintain hundreds of codes that all do the same, as well as reducing the size of each of the individual files.

Many thanks in advance

Ziggy

For upcoming training course dates see: Pricing & availability

replyReplyWed 28 Jul 2010, 12:16Trainer Stephen said...

RE: Excel VBA - Open sheet within current workbook

Hi Ziggy

Thanks for your question

I'm afraid that when you posed the question during the course I misunderstood your requirements, and they are rather more demanding than I initially thought.
The following code will open the File Dialog form


With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show

End With


However pulling sheets across to other workbooks etc. requires further coding and is too complex to be covered on the forum.

Regards

Stephen

replyReplyWed 28 Jul 2010, 13:08Delegate Ziggy said...

RE: Excel VBA - Open sheet within current workbook

Hello Stephen

That code seems to deal perfectly with element 1.

I understand that perhaps the second element in its entirety is a touch too expansive for the forum - but maybe could you offer a couple of pointers/snippits - the dots from which I could attempt to create the whole picture.

Would something like the following;
On Workbooks.Open GoSub

...provide the start?

I obviously wouldnt want to the workbook to open, just to pull the sheets into the existing.

Any pointers would be gratefully received. It is a shame the question wasn't fully understood over the last two days - we had so much unused time I am sure we could have worked out the beginnings of a solution.

Kind regards

Ziggy

 

 

Please browse our web site to find out more about
basic excel training and other Microsoft training courses.

Excel tip:

Viewing two Excel 2010 Workbooks at the same time

Did you know you can view two Excel 2010 workbooks side by side? Very useful when comparing data without constantly having to go back and forth!

1) Open both Excel workbooks
2) Select Window then select Compare Side by Side with (Spreadsheet 2)
3) When you have finished, select Window again and click Close Side by Side

View all Excel hints and tips

article

Find Microsoft Access Templates For Any Task

If you have a database related task to carry out there is very likely to be the perfect template for your needs. Below are suggestions on where to find them and other tips on getting the most effective database for the job at hand.

» Article: Access.training

forum postHow to I format final process map -i.e. centre it & size it?

» Forum post: Formatting -VISIO

hint tipTo move quickly to a specific slide, if you havent set up hyperlinks in Slide Show view; press F5 (Function 5 key) type the slide number, press Enter and then press Esc.

» Tip: Move to Slide


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training