X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Switchboard - Add Button, Access 2013    
post Apr 28 2019, 05:29 PM

Posts: 128
Joined: 22-September 10
From: Northern California Foothills

I am attempting to add some new features to an old application in which I used the switchboard for initial user interface. I want to add a button to the switchboard that will open an excel workbook using VBA.
I used the switchboard manager and chose the “run code” option. After researching on the web, I followed instructions and:

Created a module “OpenBudgetFromAccess” and placed the following function in the module

Function OpenBudgetFromAccess()
Dim Apxl As Object
Set Apxl = CreateObject("Excel.Application")

With Apxl
.Application.Visible = True
.workbooks.Open "C:\users\whatsit\desktop\BudgetTemplate.xlsm"
End With
End Function

I get the message “there was an error executing the command” no matter what I try to do – use an .xlsx extension for the workbook, tried declaring it a public function as opposed to just function, etc. I made sure the function name used in the switchboard wizard is correct… What have I missed this time around??

Thanks for any help
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    7th April 2020 - 08:47 PM