#1
|
|||
|
|||
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 |
#2
|
|||
|
|||
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
macros to excel | evh | Excel Programming | 0 | 07-20-2011 10:12 PM |
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 |
Should I uses Access or Excel? | tinkertron | Office | 5 | 03-29-2009 08:30 PM |