Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2004, 03:43 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy excel macros to vb project

Is it possible to copy an excel sheet consisting of all macros to a vb project or access database?

 
Old November 9th, 2004, 10:11 AM
Registered User
 
Join Date: Nov 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you have recorded macros in Excel you can view them using the Visual Basic Editor in Excel and copy the vb code behind the macros and paste this into Excel. You can run these macros directly from Access by defining an excel object first.

Ex. - Dim gappExcel As Excel.Application
Set gappExcel = CreateObject("Excel.application")

Just place the variable in front of each new line of code from excel and it will run it from Access. Hope this helps.
 
Old November 9th, 2004, 10:13 AM
Registered User
 
Join Date: Nov 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

self correction - meant to say copy the code from Excel to Access.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel macros mustafayildirim@msn.com Excel VBA 1 August 29th, 2007 10:50 PM
How to Run Excel Macros from ASP asptest Classic ASP Databases 7 September 13th, 2006 10:47 AM
Excel Macros with VBA kotaiah Excel VBA 1 September 11th, 2006 01:39 AM
Excel Macros with VBA ASAP kotaiah Excel VBA 0 September 9th, 2006 04:55 AM
How to get a list of macros in an Excel sheet tiyyob Excel VBA 0 January 21st, 2006 06:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.