excel-2010

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

我只是一个虾纸丫 提交于 2019-11-26 13:57:31
问题 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

Pop up the Excel Statusbar?

我是研究僧i 提交于 2019-11-26 11:49:54
I'm developing an application for excel that takes a long time to run so it would be nice to have a progress bar pop up and give some indication of the progress. I was looking at the Statusbar property in Excel and it seems to cover what I need except that it's not very obvious i.e. it's a tiny little notice in the bottom left that had I not been expecting I wouldn't have noticed which I find quite unsatisfactory. Is there a way to have the status bar pop up in a new MsgBox style window similar to what you might expect with a file transfer on windows? A progress bar type object actually

Sheet protection: UserInterFaceOnly gone

蹲街弑〆低调 提交于 2019-11-26 11:34:59
问题 In VBA Excel if I protect sheets with UserInterFaceOnly:=True option after I close and open the file again the UserInterFaceOnly mode is not active, only Password protection. The code: ActiveSheet.Protect Password:=\"myPassword\", UserInterfaceOnly:=True Why? 回答1: You can't do it without reapplying UserInterfaceOnly:=True after reopening the workbook. Taken from Excel's Vb protect method reference: If you apply this method with the UserInterfaceOnly argument set to true and then save the

Open an Excel file from SharePoint site

允我心安 提交于 2019-11-26 11:27:27
问题 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:/

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

末鹿安然 提交于 2019-11-26 10:56:32
问题 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

What is the difference between “Form Controls” and “ActiveX Control” in Excel 2010?

杀马特。学长 韩版系。学妹 提交于 2019-11-26 10:35:00
Using Microsoft Excel 2010, I noticed two kind of controls that can be inserted into a document: Form Controls and ActiveX Controls . What is the difference between them? Google is full of information on this . As Hans Passant said, Form controls are built in to Excel whereas ActiveX controls are loaded separately. Generally you'll use Forms controls, they're simpler. ActiveX controls allow for more flexible design and should be used when the job just can't be done with a basic Forms control. Many user's computers by default won't trust ActiveX , and it will be disabled; this sometimes needs

Insert picture into Excel cell [closed]

只愿长相守 提交于 2019-11-26 10:20:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I\'m tying to generate a report with pictures, but I cannot get the pictures into a single cell. I can get the pictures to \"float\" around my worksheet, but I need to put them into a cell. How can I do this? 回答1: You can add the image into a comment. Right-click cell > Insert Comment > right-click on shaded (grey

Determine if cell contains data validation

陌路散爱 提交于 2019-11-26 09:59:02
问题 I am writing a VBA code that goes through a range of cells checking if each cell has data validation (drop down menu) and if not assign one to it from a list on another sheet. I currently have trouble with the line that checks if the current cell already has data validation. I get error 1004 \"no cells were found\". Sub datavalidation() Dim nlp As Range Dim lrds As Long Dim wp As Double Dim ddrange As Range Sheets(\"DataSheet\").Select lrds = ActiveSheet.Range(\"A1\").Offset(ActiveSheet.rows

Should I turn .CutCopyMode back on before exiting my sub procedure?

孤人 提交于 2019-11-26 08:28:18
问题 In order to optimize my code, I turn off several Application Object member properties; one in particular being the .CutCopyMode property. Sub MyProcedure() With Application .ScreenUpdating = False .EnableEvents = False .CutCopyMode = False End With \' lots of code here Should I turn .CutCopyMode back on (e.g. True) again with the others before my sub finishes? \' lots of code here With Application .ScreenUpdating = True .EnableEvents = True .CutCopyMode = True \'<~~ ??? End With End Sub 回答1:

Excel: the Incredible Shrinking and Expanding Controls

独自空忆成欢 提交于 2019-11-26 08:04:20
问题 Occasionally, I\'ll happen across a spreadsheet which suffers from magic buttons or listboxes which get bigger or smaller over time. Nothing in the code is instructing this. Has anybody else experienced this joy? 回答1: The problem seems to relate to the way Windows handles non-native resolutions on monitors and can be avoided in several ways The problem can be a complete nightmare when it happens, but it only happens intermittently. We have been testing recently an excel worksheet used by a