首页 \ 问答 \ 用参数打开工作簿(Open workbook with arguments)

用参数打开工作簿(Open workbook with arguments)

问题:有没有办法打开工作簿并通过此操作传递参数/参数?

这个想法是区分用户直接打开工作簿B(将触发其自动_打开代码)的情况和从其他工作簿的代码打开工作簿B的情况


Question : Is there a way to open a workbook and pass an argument/parameter through this action ?

The idea is to differentiate the case where a user directly open Workbook B (which will trigger its Auto_Open code) and the case where Workbook B is opened from the code of an other Workbook.


原文:
更新时间:2022-01-23 16:01

最满意答案

通过使用!,它正在评估匿名函数(从而要求它运行)。 没有它,你会得到一个错误。

并且,正如其他人所说,如果您正在分配或评估它,它将反转函数返回的结果。


By using !, it's evaluating the anonymous function (thereby requiring it to run). Without that, you'd get an error.

And, as others have said, it will invert the result of whatever the function returns, if you're assigning it or evaluating it.

相关问答

更多
  • 不要给自调用函数一个名称(除了在堆栈跟踪中更容易找到它之外没有什么好处,你不应该在那时找到它,并且旧IE中的内存泄漏) 不要两次调用自调用函数 不要将自调用函数视为构造函数(通过使用new调用它) 捕获自调用函数的返回值 这样: var x = (function () { var j = function() { alert("234234"); }; return { s: j }; })(); ...
  • 您不能在表达式中声明var ,但可以将其定义放在一个中: var ShowMe; (ShowMe = function() { if ($('input:checkbox:checked').length) { $('#Save').fadeIn('slow'); } else { $('#Save').hide(); } })(); $('input:checkbox').on('click',ShowMe); You can't declare ...
  • 如果将两个文件与自调用函数连接在一起,如下所示: 文件A: (function(){...A...})() 文件B: (function(){...B...})() 文件A + B: (function(){...A...})()(function(){...B...})() 你有两个没有分隔符的语句。 当您将猫文件放在一起,然后将其缩小时,会发生这种情况 现在文件B的作者把一个分号放在前面: 文件B2: ;(function(){...B2...})() 你会得到一个工作脚本: (function ...
  • 这可能是因为您拖动它并重新创建元素节点。 你可以使用Event来解决问题。 $(document).ready(function(){ // It delegate thumb-img event to body, so whatever you recreate thumb-img,is all right $('body').on('click', '.thumb-img', function(){ var url = $(this).attr('src'); $(this).c ...
  • “自我调用函数”实际上并不是JavaScript的一部分,它只是一个术语,人们正在调用特定的代码模式(如AJAX等)。 这些模式应该在javascript工作的任何地方工作。 你所说的“自我调用函数”只是创建一个匿名函数并立即调用它(而不是将其存储在var中,作为对象值,作为函数参数等)。 也就是说,以下基本相同: var f = function(){...}; f() 和 ( function(){...} )() 所以,因为你的'自我调用函数'是javascript的一个基本部分,除非内部不工作或 ...
  • 很可能你的一个js声明缺少';' 最后。 尝试添加';' 在你的自我调用功能之前 。 在这里阅读更多 我们最终将第二个函数作为参数传递给第一个函数,然后尝试将第一个函数调用的结果作为函数调用。 第二个函数将在运行时因“...不是函数”错误而失败。 Most probably one of your js statement is missing a ';' at the end. Try add a ';' before your self invoking function. Read more here ...
  • 不,并不是所有的代码都会被执行。 当你定义你的Angular模块 (function() { 'use strict'; angular .module('myModule', []) .controller('myController', ['$http', myControllerFunc]); function myControllerFunc ($http) { // ... } })(); 执行什么只是注册模块和控制器的angular方法。 但实际的控 ...
  • 这很奇怪,因为定义构造函数的目的是能够重用它来创建许多对象。 为了您的目的,您可以使用此构造 - myNamespace.HelpModule = (function(){ //private stuff here var a = 100; return { //public stuff here b : 200, something: function() { return a + this.b; ...
  • 通过使用!,它正在评估匿名函数(从而要求它运行)。 没有它,你会得到一个错误。 并且,正如其他人所说,如果您正在分配或评估它,它将反转函数返回的结果。 By using !, it's evaluating the anonymous function (thereby requiring it to run). Without that, you'd get an error. And, as others have said, it will invert the result of whatever ...
  • 功能计划作为功能执行。 该函数返回一个对象。 就像你可以看到{ start... } 。 使用返回的对象,它会调出start函数。 这称为链接。 因此在设置功能后执行start功能。 奇怪的是超时被传递给没有参数的start函数。 The function schedule is executed as a function. That function returns an object. Like you can see with the { start... }. With the returned ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)