Tag: 用户

在不同的用户select的文件VBAmacros的Vlookup表上

我正在尝试在名为“FY_16”的工作表的S列中inputVlookup公式。 我需要用户select文件(每月更改)公式的“表格数组”。 每个月文件都会改变,但是我想要查找的列总是相同的 – 列W(但是具有不同数量的行)。 公式将查找的“表格数组”是表格的一部分。 我的代码在这一点如下: Private Function UseFileDialogOpen() MsgBox ("When the browse window opens: please select the previous months published FY16 Consulting SKU File") Dim myString As String ' Open the file dialog With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False .Show If .SelectedItems.Count = 1 Then myString = .SelectedItems(1) 'MsgBox myString UseFileDialogOpen = myString Else […]

用户完成后closuresExcel

任务非常简单: 我想从VB.net GUI打开一个Excel文档(.xls) 用户将在Excel文件上工作 用户在完成时closuresExcel文件 我想要VB.net代码释放Excel对象 问题是,当用户closures文件时,Excel对象仍然可以在任务pipe理器的进程选项卡上看到。 如果我打开文件后立即写XlApp.quit() ,用户将无法做任何事情。 如何知道用户何时closuresExcel文件,以便我可以运行代码来释放Excel对象? 我到目前为止: Dim xlapp as new Excel.Application Dim xlwb as excel.workbook = xlapp.workbooks.open("file path") xlapp.visible = true 'The user do work here' 'What should I put in between here to detect when the user exits the excel file???" xlwb.close() xlapp.quit() releaseObject(xlwb) releaseObject(xlApp)