一位正在工作的同事对我们的一个宏工作簿进行了一些更改,现在在我的PC上,当我尝试运行它时,我只收到了可怕的运行时错误'32809'.这个最新版本在他的PC和我们测试它的另一个同事的PC上运行良好.以前的版本在我们所有的PC上运行良好,所有这些都运行Excel 2010.
当宏尝试选择名为"Info"的工作表索引1时,将引发错误.我知道选择/激活不是必需的,但我现在正在使用此工作簿,并试图解决为什么我一个人会收到此错误.
我试过了:
一切都没有成功.然后我在即时窗口看到了一些混乱,发现即使是一个简单的:
Debug.Print ThisWorkbook.Worksheets(1).Name
Run Code Online (Sandbox Code Playgroud)
会抛出运行时错误,这让我相信Workheet已经破坏了.我在工作表中添加了几个事件,包括_Activate和_Change,但是在确认之后,没有任何事件会触发:
Application.EnableEvents = True
Run Code Online (Sandbox Code Playgroud)
我添加了一个简单的Test Sub如下:
Public Sub Test()
Dim ws As Worksheet
Dim sheetNum As Integer
For Each ws In ThisWorkbook.Worksheets
ws.Select ' Selects all Sheets Without Error
Debug.Print ws.Name ' Prints All Worksheet Names Fine
Next ws
Set ws = ThisWorkbook.Worksheets(1)
ws.Select ' Selects Sheet 1 Without Error
' Prints all but sheetNum = 1, Run-time Error 32809
For sheetNum = 7 To 1 Step -1 …Run Code Online (Sandbox Code Playgroud) 我有一个 div,它有一个相当长的样式列表,内联应用这些样式看起来很荒谬,但是,div 接受一个背景图像 url 的参数,该参数会在更新状态时发生变化。
内联样式,我的元素如下所示:
<div style={{width: 55,
height: 55,
position: 'fixed',
borderRadius: '50%',
bottom: 130,
zIndex: 200,
backgroundImage: `url(${this.state.avatar})`}}>
Run Code Online (Sandbox Code Playgroud)
但是,当我这样做时,我的背景图像完全消失:
<div className="avatar" style={{backgroundImage: `url(${this.state.avatar})`}}>
Run Code Online (Sandbox Code Playgroud)
这里的修复是什么?
在谷歌上搜索这个问题时,我发现以下情况让我相信这不应该是一个问题所以我确定我做错了什么但是无法解决.
有时我在身份验证过期后导航到我的应用程序时,它会加载页面而不是重定向到/ login,在控制台中我看到:
Error: permision denied at /the/firebase/url: Client doesn't have permission to access the desired data
Run Code Online (Sandbox Code Playgroud)
如果我重新加载页面,我将按预期成功定向到/ login.
angular.module('app',['firebase','ngRoute','ngAnimate','ui.bootstrap'])
.factory("Auth",function($firebaseAuth){
var ref = new Firebase("https://app.firebaseio.com");
return $firebaseAuth(ref);
})
.run(['$rootScope','$location','$window',function($rootScope,$location,$window){
$rootScope.$on('$routeChangeError',function(event,next,previous,error){
$location.path('/login');
});
if($window.localStorage.getItem('app-last-list')) {
$location.path('/lists/' + $window.localStorage.getItem('app-last-list'));
}
}])
.config(['$routeProvider',function($routeProvider){
$routeProvider
.when('/',{
templateUrl: 'views/list-view.html',
controller: 'ListViewController',
resolve: {
"currentAuth": ['Auth', function(Auth) {
return Auth.$requireAuth();
}]
}
})
.when('/login',{
templateUrl: 'views/login-view.html',
controller: 'LoginController'
})
.when('/lists/:id', {
templateUrl: 'views/list-items-view.html',
controller: 'ListItemsController',
resolve: {
"currentAuth": ['Auth',function(Auth){
return Auth.$requireAuth();
}],
"list": …Run Code Online (Sandbox Code Playgroud) 我是新来的反应。当我的状态发生变化时,为什么我的页面在鼠标悬停和鼠标移出时不会重新呈现?如果我查看console.log,我可以看到状态变化。但我无法让它发挥作用。这是我的代码:
export default class Nav extends React.PureComponent {
constructor(props) {
super(props);
this.navLevelOneId = '';
this.state = {
showSubMenu: []
};
}
// Mouse over function
handleHover = (id,event) => {
let showSubMenu=this.state.showSubMenu;
showSubMenu[id]=!showSubMenu[id]
this.setState({showSubMenu: showSubMenu}, () => {
console.log(this.state.showSubMenu);
});
}
render() {
return (
<div ref="megaMenu" className="navbar navbar-default navbar-static-top">
<div className="container">
<div className="navbar-header">
<button type="button" className="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span className="icon-bar"></span>
<span className="icon-bar"></span>
<span className="icon-bar"></span>
</button>
</div>
<div className="navbar-collapse collapse">
<ul className="nav navbar-nav">
<li onMouseOver={this.handleHover.bind(this,0)} onMouseOut={this.handleHover.bind(this,0)}>
<a>Home</a>
</li> …Run Code Online (Sandbox Code Playgroud) 我目前正在尝试使用一个屏幕制作一个应用程序,其中屏幕的背景由以用户当前坐标为中心的地图占据。在下面的代码中,我在 App 类组件的状态中将经度和经度保存为 null。然后,我使用继承的方法“componentDidMount()”更新用户当前位置的状态,最后在 render() 中我使用 this.state.latitude 和 this.state.longitude 来通知纬度和经度的值地图视图。
代码无法编译。使用console.log,我将问题隔离为render() 被调用两次,我的console.log 语句首先将空值输出到控制台,然后输出用户的当前位置。
所以两个问题。
1)为什么console.log会向控制台输出两次不同的值,一次是传入的状态值,一次是componentDidMount()更新的状态值?
2) 如何运行函数 navigator.geolocation.getCurrentPosition() 来保存用户的当前位置并将其传递给 MapView 以便代码首先编译?
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = { latitude: null, longitude: null };
}
componentDidMount() {
navigator.geolocation.getCurrentPosition(position => {
this.setState({
latitude: position.coords.latitude,
longitude: position.coords.longitude,
});
});
}
render() {
return (
<View style={styles.container}>
<MapView
style={styles2.map}
initialRegion={{
latitude: this.state.latitude,
longitude: this.state.longitude,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
{console.log(this.state.latitude)}
{console.log(this.state.longitude)}
</View>
);
}
}
Run Code Online (Sandbox Code Playgroud) reactjs ×3
javascript ×2
angularfire ×1
angularjs ×1
css ×1
excel ×1
excel-2010 ×1
excel-vba ×1
firebase ×1
html ×1
react-native ×1
vba ×1