当我尝试使用以下代码访问Excel电子表格时,我在安装了Office 2007(版本12)的Visual Studio 2012中使用C#定义工作簿对象wrkbuk时出现"库未注册"错误
Microsoft.Office.Interop.Excel.Application excapp = new Microsoft.Office.Interop.Excel.Application();
string bookname = @"C:\Users\Public\Documents\RECRUITMENT & SELECTION\MOVEMENTS\MOVEMENTS\Miscellaneous Documents\VacanciesREAL.xls";
Workbook wrkbuk = excapp.Workbooks.Open(bookname);
Worksheet wrksht = new Worksheet();
Run Code Online (Sandbox Code Playgroud)
错误的详细信息是
System.InvalidCastException未处理HResult = -2147467262
Message =无法将类型为"Microsoft.Office.Interop.Excel.ApplicationClass"的COM对象强制转换为接口类型"Microsoft.Office.Interop.Excel._Application".此操作失败,因为由于以下错误,对IID为"{000208D5-0000-0000-C000-000000000046}"的接口的COM组件的QueryInterface调用失败:库未注册.(HRESULT的例外情况:0x8002801D(TYPE_E_LIBNOTREGISTERED)).来源= mscorlib程序
我已经在VS 2012附带的Office 14主Interop程序集中创建了对Microsoft.Office.Interop.Excel.dll的引用,并且还修复了该问题的Office 12版本.我尝试用regasm注册dll,但这也无济于事.
我可以使用Office 14和Office 12 dll在以下行上创建工作表wrksht,这样问题似乎只会影响工作簿定义.
2013年12月17日
尝试重新安装Office 2007无济于事,但发现这个解决方案,这是有效的.它在
问题是来自多个版本的Office的代码 - 我有来自Office 14的代码,可能来自VS 2012安装
我怀疑VS 2012 RC已经安装了Office 2013类型库,并且现在已经注册了重复版本.我收到了特定的错误消息
('无法转换_Application'....'TYPE_E_LIBNOTREGISTERED')
在凌乱的卸载之后,然后重新安装旧版本的Office.我通过遵循另一个论坛帖子的建议来解决它,我很遗憾找不到...基本上我在错误消息中搜索了注册表中的CLSID,所以,{00020970-0000-0000-C000-000000000046}.它的注册表项包含两个键,其中一个键称为"TypeLib",后者又包含另一个类型库的CLSID.然后,我再次从头开始搜索注册表,找到第二个CLSID,这导致我进入相关的互操作类型库.它有两个条目.... 8.3和8.4,更大的数字对应于Office的更高版本....我删除了...并立即能够运行我的程序.
我试图获得两个日期时间之间的差异,并将其作为一个返回datetime.我找到了使用的例子,diff但我似乎无法做到正确.
$timein = date("Y-m-d H:i:s");
$timeout = date("Y-m-d 20:00:00");
$totaltime = $timein->diff($timeout);
Run Code Online (Sandbox Code Playgroud)
但是$totaltime记录0000-00-00 00:00:00到我的DB.这是因为我没有格式化我的全时变量吗?
我将onclick在按钮中的事件中调用异步函数。但它不起作用。是否可以在按钮 onlick 中调用异步函数?
这是代码。
过滤按钮
const FilterButton = (props) => {
return (
<div className="p-2 ">
<button className="btn btn-secondary" onClick={props.fetchInvoices}>Filter</button>
</div>
);
};
Run Code Online (Sandbox Code Playgroud)
fetchInvoices 异步函数
fetchInvoices = async () => {
const invoices = await getInvoices(this.currentState.params);
this.props.store.dispatch(UpdateInvoices(invoices));
};
Run Code Online (Sandbox Code Playgroud)
将函数传递给组件的代码
<SearchField store = {this.props.store} fetchInvoices={this.fetchInvoices}/>
Run Code Online (Sandbox Code Playgroud) 我几乎是新手react.我正在尝试创建一个简单的编辑和创建掩码.这是代码:
import React, { Component } from 'react';
import Company from './Company';
class CompanyList extends Component {
constructor(props) {
super(props);
this.state = {
search: '',
companies: props.companies
};
}
updateSearch(event) {
this.setState({ search: event.target.value.substr(0,20) })
}
addCompany(event) {
event.preventDefault();
let nummer = this.refs.nummer.value;
let bezeichnung = this.refs.bezeichnung.value;
let id = Math.floor((Math.random()*100) + 1);
$.ajax({
type: "POST",
context:this,
dataType: "json",
async: true,
url: "../data/post/json/companies",
data: ({
_token : window.Laravel.csrfToken,
nummer: nummer,
bezeichnung : bezeichnung,
}),
success: function (data) { …Run Code Online (Sandbox Code Playgroud) 我有一个问题react和react-router.当我单击链接时(在我的示例contact中Footer.js),URL会更改,但Location不会显示所需的组件.当我刷新网站时,会显示正确的组件.
App.js:
import React, { Component } from 'react';
import { BrowserRouter as Router, HashRouter, Route, Link } from 'react-router-dom';
import 'bootstrap/dist/css/bootstrap.css';
import Footer from './Footer.js';
import Navigation from './Navigation.js';
import Background from './Background.js';
import Home from './Home.js';
import Products from './Products.js';
import Industries from './Industries.js';
import Partner from './Partner.js';
import Location from './Location.js';
import MeetUs from './MeetUs.js';
import ScrollUp from './ScrollUp.js';
import Divider from './Divider.js';
import Country from './Country.js'; …Run Code Online (Sandbox Code Playgroud) 我是新手cypress,请耐心等待。;-) 我确定这是一个简单的问题,我已经阅读了 的文档cypress,但在我的cypress测试中似乎仍有一些错误。xhr当我单击要测试的页面的不同语言时,我想等待请求完成。当我使用时它有效,wait(5000)但我认为,等待xhr请求完成的方法比修复等待 5 秒更好。这是我的代码。任何帮助或提示表示赞赏:
describe('test',() => {
it('should open homepage, page "history", click on English language, click on German language',() => {
cy.server();
cy.route('POST','/ajax.php').as('request');
cy.visit('http://localhost:1234/history');
cy.wait('@request');
cy.get('div[class="cursorPointer flagSelect flag-icon-gb"]').click({force:true});
cy.route('POST','/ajax.php').as('request');
cy.wait(['@request']);
//cy.wait(5000); // <- this works, but seems to be not the best way
cy.get('h2').should(($res) => {
expect($res).to.contain('History');
})
cy.get('.dataContainer').find('.container').should('have.length', 8);
});
});
Run Code Online (Sandbox Code Playgroud)
最后检查
cy.get('.dataContainer').find('.container').should('have.length', 8);
Run Code Online (Sandbox Code Playgroud)
不成功,因为xhr请求还没有完成。该xhr请求被解雇,当图标上的点击完成:
cy.get('div[class="cursorPointer flagSelect flag-icon-gb"]').click({force:true});
Run Code Online (Sandbox Code Playgroud)
这是 xhr 请求的图像,如果这有助于找到错误: …
我是 的新手typo3。我的一个朋友问我是否可以为他升级他的安装,因为我是开发人员。所以我检查了我是否可以做到。我执行了几个步骤将安装从 升级7.6.9到8.7.3. 现在我在安装工具部分结束了important actions。有一点TCA migrations。
那里说:
需要应用 TCA 迁移 检查以下列表并应用所需的更改。
TCA 表“tx_myredirects_domain_model_redirect['columns']['destination']['config']['wizards']['link']['icon']”中向导“link”的图标路径已迁移到 tx_myredirects_domain_model_redirect[ '列']['目标']['配置']['向导']['链接']['图标']" = '操作向导链接'. ...
这只是提供信息还是我必须修改所列内容中的某些内容?
再次抱歉,如果这是一个新手问题,但我实际上是typo3.
我们希望使用laravel作业向客户发送发票。我们有这个工作班。它期望构造函数中的支付模型。
namespace App\Jobs;
use App\Jobs\Job;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
class SendInvoiceEmail extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;
public $paypalModel;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct($paypalModel)
{
$this->paypalModel = $paypalModel;
}
/**
* The number of times the job may be attempted.
*
* @var int
*/
public $tries = 5;
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
$rechnung …Run Code Online (Sandbox Code Playgroud) 我有这段代码,它可以过滤我的数据。我问我,是否有一种方法可以不显式过滤每个字段(id、mandant、zonenlogik...)。也许有一种更流畅的方法可以在所有字段上设置过滤器而无需显式调用它们?
let filteredList = this.state.freights.filter((freight) => {
if (freight.id.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.mandant.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.zonenlogik.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.frachtart_nr.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.transportart_nr.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.spedit_nr.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.spedit2_nr.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
if (freight.lager_nr.toLowerCase().indexOf(this.state.search.toLowerCase()) !== -1) {
return freight;
}
});
Run Code Online (Sandbox Code Playgroud) 我正在尝试将 PWA 应用程序的 start_url 从一个页面更改为另一个页面,但需要了解其工作原理。谁能告诉我我的 PWA 应用程序用户(旧的start_url)的用户会发生什么?是否有某种更新发生后,老用户可以获得更新start_url。
例如:
具有旧 start_url 的 PWA:www.testweb.com/oldurl
具有新 start_url 的 PWA:www.testweb.com/newurl
在我更改start_url.