excel-2010

VBScript - How to make program wait until process has finished?

非 Y 不嫁゛ 提交于 2019-11-27 09:41:59
I have a problem in a VBScript that I am using with a VBA/Excel macro and a HTA. The problem is just the VBScript, I have the other two components, i.e. the VBA macro and HTA front-end working perfectly. But before I explain the problem, I think for you to help me I must help you understand the context of the VBScript. So, basically all components (VBScript, VBA macro and HTA) are parts of a tool that I am building to automate some manual chores. It pretty much goes like this: A - HTA ~~~~~~~~~~~~ User selects some files from the HTA/GUI. Within the HTML of the HTA there is some VBScript

Excel CustomTaskPane with WebBrowser control - keyboard/focus issues

北战南征 提交于 2019-11-27 09:40:49
I am having this exact issue https://social.msdn.microsoft.com/Forums/vstudio/en-US/e417e686-032c-4324-b778-fef66c7687cd/excel-customtaskpane-with-webbrowser-control-keyboardfocus-issues?forum=vsto Also mentioned here https://connect.microsoft.com/VisualStudio/feedback/details/521465/the-focus-issue-between-excel-cells-and-excel-customtaskpane-with-webbrowser-control I am writing an Excel 2010 plugin using Visual Studio Professional 2013. I've created a simple CustomTaskPane with a System.Windows.Forms.WebBrowser child filing it. The plugin works just fine and I am able to navigate inside the

How do I use checkboxes in an IF-THEN statement in Excel VBA 2010?

隐身守侯 提交于 2019-11-27 09:06:38
I need to use the value of checkboxes for an IF-THEN statement. Based on what the user checks, the way I have to calculate things changes. However, I can't figure out how to use the checkbox values, or how to detect them. Here is the code I have so far: Private Sub Workbook_Open() Range("E1:F7,A1:A4,B1:B4,C1:C3").Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .ColorIndex = 0 .TintAndShade = 0 .Weight = xlThin End With With Selection.Borders(xlEdgeBottom)

Open an Excel file from SharePoint site

馋奶兔 提交于 2019-11-27 09:05:15
I'm trying to open an Excel file from SharePoint using VBA. Because the file I'm looking for might be different each time I run the macro, I want to be able to view the SharePoint folder and select the file I need. The code below works fine when I want to look for a file on a network drive, however when I replace that with a SharePoint address I get "run-time error 76: Path not found". Sub Update_monthly_summary() Dim SummaryWB As Workbook Dim SummaryFileName As Variant ChDir "http://sharepoint/my/file/path" SummaryFileName = Application.GetOpenFilename("Excel-files,*.xls", _ 1, "Select

Excel: Searching for multiple terms in a cell

旧巷老猫 提交于 2019-11-27 08:55:41
I use this handy equation to search for a term inside of a cell in excel. =IF(ISNUMBER(SEARCH("*Gingrich*",C1)),"1","") This equation searches for the presence of Gingrich in C1, if it exists, it displays a 1. All I'd like to do is search for more than one term at a time. Anyone know how to add an OR function into this so I can search for Gingrich OR Obama OR Romney etc... ? Another way =IF(SUMPRODUCT(--(NOT(ISERR(SEARCH({"Gingrich","Obama","Romney"},C1)))))>0,"1","") Also, if you keep a list of values in, say A1 to A3, then you can use =IF(SUMPRODUCT(--(NOT(ISERR(SEARCH($A$1:$A$3,C1)))))>0,"1

(VBA or Formula) to open hyperlink from a cell and save/rename downloaded file from new cell value

微笑、不失礼 提交于 2019-11-27 08:31:39
问题 Program: Excel 2010 Experience Level: Basic Question: I have a table of links, I want to open each link (they are .csv/.xlsx files on a secure server which I have to login to), then saveas with a file name generated by a 3rd row of information Column (C) to keep the BatchID intact (as below). | A | B | C | | Batch Date | links | New name | |------------|--------------|----------| | 3/03/2014 | View | 20140303 | | 2/05/2014 | View | 20140205 | | 1/02/2014 | View | 20140102 | | 12/01/2013 |

How does one restore default case to a variable in VBA (Excel 2010)?

拟墨画扇 提交于 2019-11-27 08:02:10
At some point I accidentally named a variable range (all lower-case) and since then the Visual Basic for Applications editor refuses to use Range (Pascal-cased); it will auto-correct it to lower-case. How can I reset its "brain" to forget about my past transgression? NOTE: I've tried doing a global replace-all, but the moment I edit any single line -- it re-corrects once again. Obviously this is a very very minor, cosmetic issue but watching the R go limp every time I type Range is irritating. You need to change the name of the variable in a declaration line ( Dim statement for example)

Wildcard search of dictionary

妖精的绣舞 提交于 2019-11-27 07:57:29
问题 After searching google and SO, I see that there is a way for me to search a dictionary for an existing key: dict.exists("search string") My question is how can I search a dictionary using a wildcard: dict.exists("search*") I want to search the dictionary for a term first because my macro has the user select a group of files (the file name as dictionary key and the full path as the value) and I want to determine if files of a certain naming convention are present in the group BEFORE I iterate

Why would the Excel Interop remove an image after processing a file?

泄露秘密 提交于 2019-11-27 07:56:25
问题 Excel Interop is removing images from processed files. I’m using the Excel Interop, no third-party components are present (that I'm aware of). The workflow is -- create a copy (target) of a file (template), populate cells, change radio-button state Create copy (target) of a pre-existing .xslm file (template) Open target via Excel Interop Populate target cells, change radio-button state The worksheet with an image is not modified Close target On my dev machine, the target file looks great --

.xlsx and xls(Latest Versions) to pdf using python

半城伤御伤魂 提交于 2019-11-27 07:55:31
With the help of this .doc to pdf using python Link I am trying for excel (.xlsx and xls formats) Following is modified Code for Excel: import os from win32com import client folder = "C:\\Oprance\\Excel\\XlsxWriter-0.5.1" file_type = 'xlsx' out_folder = folder + "\\PDF_excel" os.chdir(folder) if not os.path.exists(out_folder): print 'Creating output folder...' os.makedirs(out_folder) print out_folder, 'created.' else: print out_folder, 'already exists.\n' for files in os.listdir("."): if files.endswith(".xlsx"): print files print '\n\n' word = client.DispatchEx("Excel.Application") for files