sub

How to add a custom Ribbon tab using VBA?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am looking for a way to add a custom tab in the Excel ribbon which would carry a few buttons. I chanced on some resources addressing it via Google but all look dodgy and outrageously complicated. What is a quick and simple way to do that ? I'd like the new tab to get loaded when my VBA gets loaded into Excel.. UPDATE : I tried this example from here but get an "object required" error on the last instruction : Public Sub AddHighlightRibbon() Dim ribbonXml As String ribbonXml = " " ribbonXml = ribbonXml + " " ribbonXml = ribbonXml + " "

Git submodule head 'reference is not a tree' error

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a project with a submodule that is pointing to an invalid commit: the submodule commit remained local and when I try to fetch it from another repo I get: $ git submodule update fatal : reference is not a tree : 2d7cfbd09fc96c04c4c41148d44ed7778add6b43 Unable to checkout '2d7cfbd09fc96c04c4c41148d44ed7778add6b43' in submodule path 'mysubmodule' I know what the submodule HEAD should be, is there any way I can change this locally, without pushing from the repo that does have commit 2d7cfbd09fc96c04c4c41148d44ed7778add6b43 ? I'm

How to pause for specific amount of time? (Excel/VBA)

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an Excel worksheet that has the following macro. I'd like to loop it every second but danged if I can find the function to do that. Isn't it possible? Sub Macro1() ' ' Macro1 Macro ' Do Calculate 'Here I want to wait for one second Loop End Sub 回答1: Use the Wait method : Application.Wait Now + #0:00:01# or (for Excel 2010 and later): Application.Wait Now + #12:00:01 AM# 回答2: Add this to your module Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Or, for 64-bit systems use: Public Declare PtrSafe Sub Sleep Lib

VBA code doesn't run when cell is changed by a formula

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Worksheet A has ranges of data that are collected from Worksheet B . Worksheet A has a macro that calculates if the data is above a value then calls an email module to email selected users. When the data is manually input on Worksheet A the Macro works, however when data is pulled from Worksheet B it doesn't fire. I'm not sure what I need to change in my VBA code. Private Sub Worksheet_Change(ByVal Target As Range) Call MailAlert(Target, "B5:M5", 4) Call MailAlert(Target, "B8:M8", 7) Call MailAlert(Target, "B11:M11", 6) Call MailAlert(Target

When to use Spring Security`s antMatcher()?

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When do we use antMatcher() vs antMatchers() ? For example: http .antMatcher("/high_level_url_A/**") .authorizeRequests() .antMatchers("/high_level_url_A/sub_level_1").hasRole('USER') .antMatchers("/high_level_url_A/sub_level_2").hasRole('USER2') .somethingElse() .anyRequest().authenticated() .and() .antMatcher("/high_level_url_B/**") .authorizeRequests() .antMatchers("/high_level_url_B/sub_level_1").permitAll() .antMatchers("/high_level_url_B/sub_level_2").hasRole('USER3') .somethingElse() .anyRequest().authenticated() .and() ... What I

Which HTTP code to use for an empty subresource in a REST API?

匿名 (未验证) 提交于 2019-12-03 02:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Let's say I've a resource articles at /articles . These articles may have related articles, so I fetch them by GETting /articles/{id}/related . What should I return is there is no related articles? I can think of: 404 Not Found , maybe with an empty collection 204 No Content 200 Found with an empty collection Any advices? (please give arguments) By the way, it may applies to pagination. If I request page 3 of 2, then the page 3 will return an empty set, should It be a 404 ? 回答1: 404 is not what you are looking for. It's an error condition.

Testing Android IAP/In-App Purchase Subscriptions

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am implementing several Android applications to be launched on Google Play and they all have subscriptions using the Google IAP auto-renewing subscription product type. To test the app I have done the following: Uploaded a draft binary to Google Play but not published it. Created and published the Subscription product in the developer console. Added my Google account to the list of test accounts in the developer console Exported my APK from eclipse (with the same package name and version name/code as the one uploaded to Google

Best Way to Invoke Any Cross-Threaded Code?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know that this question has been asked before, but I'm looking for a way to: streamline the creation of safe cross-threaded code. reuse this code in any situation (no Windows Forms references). Here's what I have so far, but I want to remove the Windows Forms references. Any ideas? public delegate void SafeInvokeDelegate(System.Action action); public class SafeInvoke { private readonly System.Windows.Forms.Control _threadControl; public SafeInvoke() { _threadControl = new System.Windows.Forms.Control(); } public void Invoke(System.Action

How to get a sub array of array in Java, without copying data?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have some library of classes, working with my data, which is being read into buffer. Is it possible somehow to avoid copying arrays again and again, passing parts of data deeper and deeper into processing methods? Well, it sounds strange, but in my particular case, there's a special writer, which divides data into blocks and writes them individually into different locations, so it just performs System.arraycopy, gets what it needs and calls underlying writer, with that new sub array. And this happens many times. What is the best approach

Parsing JSON in Excel VBA

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the same issue as in Excel VBA: Parsed JSON Object Loop but cannot find any solution. My JSON has nested objects so suggested solution like VBJSON and vba-json do not work for me. I also fixed one of them to work properly but the result was a call stack overflow because of to many recursion of the doProcess function. The best solution appears to be the jsonDecode function seen in the original post. It is very fast and highly effectively effective; my object structure is all there in a generic VBA Object of type JScriptTypeInfo. The