excel-automation

“show formulas” in excel using python & win32com

主宰稳场 提交于 2019-12-13 03:55:29
问题 How can display/show all of the formulas in an Excel workbook using Python3 and win32com.client, like I can do interactively with Cntrl-` I believe I have to use the Windows DisplayFormulas Property but I don't know how to access the ActiveWindow to do this in Python. Here is the code I have up to open a spreadsheet and the first workbook and save it: import win32com.client excel = win32com.client.Dispatch("Excel.Application") wb = excel.Workbooks.Open(wb_path) ws_index_list = [1] wb

Automation Error when invoking method on WCF mex Moniker with Excel

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 08:32:21
I successfully created a service moniker as client for my WCF service. But I'm unable to call any method on the moniker. At the WCF service end I have a dummy method named TestMethod, as follows: Public Function TestMethod(ByVal TestValue As String) As String Implements ICustomerService.TestMethod Return "You said.... " & TestValue End Function Following code creates the Moniker in Excel. Public Sub WCFMexMonkierDemo() ' Create a string for the service moniker including the content of the WSDL contract file Dim mexMonikerString As String mexMonikerString = "service:mexAddress='http://localhost

Trying to exit C# Excel Workbook without a dialog box

╄→гoц情女王★ 提交于 2019-11-30 08:30:07
问题 I am using Microsoft Office Interop to edit some excel files and when I close them I use outputExcelWorkBook.Close(false, paramMissing, paramMissing); But a dialog box still comes up, even though I passed false as the first parameter. I have also tried it with true and giving it a file path as the second parameter but in both cases a dialog box comes up asking me if I want to save before closing. Can anyone tell me what's going on here? 回答1: Try setting the Application.DisplayAlerts property

What is the FileType number for PDF in Excel 2007 that is needed to save a file as PDF through the API?

老子叫甜甜 提交于 2019-11-29 15:33:44
I need to call a function in order to save an Excel workbook. I installed the PDF save addon for Excel 2007 but now I need to know what the number code is for the file format for when I save the excel file. An example of the excel file format numbers can be found here. http://www.dailydoseofexcel.com/archives/2006/10/29/saveas-in-excel-2007/ FileExtStr = ".xlsb": FileFormatNum = 50 FileExtStr = ".xlsx": FileFormatNum = 51 FileExtStr = ".xlsm": FileFormatNum = 52 FileExtStr = ".xls": FileFormatNum = 56 FileExtStr = ".csv": FileFormatNum = 6 FileExtStr = ".txt": FileFormatNum = -4158 FileExtStr

Passing value to excel inputbox from VB.NET

不问归期 提交于 2019-11-27 22:20:51
I am trying to automate data population on some excel sheets that have some macros. Now the excel is protected and I cannot get the secret key. Now I am able to run the macros but when I try to pass arguments I get arguments mismatch. If I just run the macro with the name, I get an inputbox which takes an extra argument as input and auto generates some of the values for the columns. I have to manually enter this value into the inputbox as of now. Is there any way that I could automate that process, i.e capture the inputbox thrown by the macro in the vb.net script and enter the values from

Passing value to excel inputbox from VB.NET

泄露秘密 提交于 2019-11-26 23:08:43
问题 I am trying to automate data population on some excel sheets that have some macros. Now the excel is protected and I cannot get the secret key. Now I am able to run the macros but when I try to pass arguments I get arguments mismatch. If I just run the macro with the name, I get an inputbox which takes an extra argument as input and auto generates some of the values for the columns. I have to manually enter this value into the inputbox as of now. Is there any way that I could automate that