Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2011, 09:08 AM
Jhouk5244 Jhouk5244 is offline Run macros between excel and access Windows XP Run macros between excel and access Office 2003
Novice
Run macros between excel and access
 
Join Date: Aug 2011
Posts: 2
Jhouk5244 is on a distinguished road
Default Run macros between excel and access

Hey everyone,



I'm trying to find code so that when I click on a command button in excell, it runs my database in access and refreshes the data tables there linked to in excel.

I know I need code and I know where I have to put it but I have no programming backround so I don't know how to go about it. Any help you guys can provide would be greatly appreciated

P.S. I'm finding more and more that coding knowledge would be extremely useful to have at my job, any suggestions on how to start learning
Reply With Quote
  #2  
Old 08-18-2011, 11:06 AM
Jhouk5244 Jhouk5244 is offline Run macros between excel and access Windows XP Run macros between excel and access Office 2003
Novice
Run macros between excel and access
 
Join Date: Aug 2011
Posts: 2
Jhouk5244 is on a distinguished road
Default Ok New issue

Alright I'm getting close, I now have my database and excell sheet linked but when I run my code I get an error on line 10 where is says Range ("E8"). The error is Run-Time Error "1004" Select method of range class failed.

I have no idea what goes there, I just want to make sure those data tables update. Thanks for the help!

Private Sub CommandButton1_Click()
Dim obj As New Access.Application
obj.OpenCurrentDatabase ("\\Ohhfp01\users\jhouk\My Documents\CDP Documents\Leadership Dashboard\VSG Planning Dashboard\Dashboard Live Database.mdb")
obj.DoCmd.RunMacro "Dashboard Update"
obj.CloseCurrentDatabase
Set obj = Nothing
ActiveWorkbook.Worksheets("LMR DATA").Select
Range("E8").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
macros to excel evh Excel Programming 0 07-20-2011 10:12 PM
Run macros between excel and access Access or Excel? hektisk Office 11 04-11-2011 04:24 PM
Oulook Deletes Emails Attached with Excel Files That Have Macros Slacker Outlook 4 01-24-2011 03:17 PM
Excel 2003 SP3 bug when running Macros EnricoVenturi Excel 0 09-06-2009 08:11 AM
Run macros between excel and access Should I uses Access or Excel? tinkertron Office 5 03-29-2009 08:30 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft