本文介绍了从访问CUSTOM UI RIBBON XML打开EXCEL练习册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Access 2010中的自定义UI功能区中使用对象来打开Excel工作簿,我将数据链接到数据库。 我在下面的VBA模块中创建了Sub(不确定它是否需要sub或function),我在Ribbon XML代码中列出了'OpenScheduleWorkBook'
作为OnAction字符串,但它确实似乎找到Sub。 有人可以告诉我这段代码是否适用于打开现有工作簿? 我知道这似乎是一个简单的任务,但我不是一个代码专家.-谢谢,JS。

I am trying to use objects in my custom UI ribbon in Access 2010 to open an Excel Workbook which I have data linked to the database.  I created the Sub(not sure if it needs to be sub or function) pasted below in a Module in VBA and I've listed 'OpenScheduleWorkBook' as the OnAction string in the Ribbon XML code, but it does seem to find the Sub.  Can someone tell me if this code should work to open an existing workbook?  I know it seems like a simple task, but I am not exactly a code expert.-Thanks, JS.

SUB OpenScheduleWorkbook(ByVal控制为IRibbonControl)

Const strTemplate =" Z:\ DASHBOARD\SCHEDULE\MASTER SCHEDULE.xlsx" b
    Dim objXl As Object

    Dim objWb As Object

   昏暗的对象作为对象

    On Error GoTo ErrHandler

    '启动Excel

结束子

SUB OpenScheduleWorkbook (ByVal control as IRibbonControl)
Const strTemplate = "Z:\DASHBOARD\SCHEDULE\MASTER SCHEDULE.xlsx"
    Dim objXl As Object
    Dim objWb As Object
    Dim objWs As Object
    On Error GoTo ErrHandler
    ' Start Excel
End sub

下面是我试图用来从上面运行Sub的XML:

Below is the XML I'm attempting to use to run the Sub from above:

< button id =" SchedForm" imageMso =" FilePrint"

size =" large" label =" SCHEDULE WORKBOOK" screentip =" UPDATE SCHEDULE"

onAction =" OpenScheduleWorkbook" />

<button id="SchedForm" imageMso="FilePrint"
size="large" label="SCHEDULE WORKBOOK" screentip="UPDATE SCHEDULE"
onAction="OpenScheduleWorkbook" />

推荐答案


这篇关于从访问CUSTOM UI RIBBON XML打开EXCEL练习册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 14:56