Windows error 0x8002000B, -2147352565

Detailed Error Information

DISP_E_BADINDEX[1]

MessageInvalid index.
Declared inwinerror.h

HRESULT analysis[2]

FlagsSeverityFailure
Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode2 (0x002)
NameFACILITY_DISPATCH[2][1]
DescriptionThe source of the error code is a COM Dispatch.[2][1]
Error Code11 (0x000b)

Questions

14votes
1answer

Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX) for System.Runtime.InteropServices.COMException

I have a part of code which tries to export data (from database) to Excel. When I am trying to perform this task, it is generating this error: System.Runtime.InteropServices.COMException occurred Additional information: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Code which is generating this error: string ExcelFileName = RootFolder + [...] read more
c#
.net
excel
interop
excel-interop
6votes
2answers

Excel with VB.NET (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I'm trying to create an Excel file from VB.net from my first time. I already added the Microsoft.Office.Excel reference, Import the Microsoft.Office.Interop Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet As Excel.Worksheet Dim misValue As Object [...] read more
vb.net
excel
5votes
2answers

C# Excel interop: Exception from HRESULT (DISP_E_BADINDEX)

I'm trying to deploy an application that works fine on my development pc and some other workstations. However, some users receive an error that I can't seem to grasp. The program is a C# dotNet app with Excel.Interop functionality (Office 2003). I seem to be getting a problem with 'indexes'. [...] read more
c#
excel
indexing
interop
4votes
1answer

Get default project directory in Visual Studio 2010 extension

How do I get the default project creation directory from within a Visual Studio 2010 extension? By default this directory is: C:\Users\<username>\Documents\Visual Studio 2010\Projects I'm guessing this is done via the Tools->Options window, but I don't know how to get at this via the SDK. At first glance the following [...] read more
c#
visual-studio-2010
visual-studio-extensions
visual-studio-sdk
3votes
2answers

getting worksheet by name in vsto workbook application

This code add a worksheet to my workbook in a VSTO excel workbook application via a ribbon: Globals.ThisWorkbook.Worksheets.Add(); Excel.Window window = e.Control.Context; Excel.Worksheet activeWorksheet =((Excel.Worksheet)window.Application.ActiveSheet); The added worksheet is also the active one (obviously). How can I get existing worksheets in workbook application - ideally by name? This gives me [...] read more
c#
vsto
office-interop
2votes
1answer

Invalid index (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) when calling AddIns.Item[0]

I am receiving Invalid Index COM exception when calling Excel.AddIns.Item[0]. Excel.AddIns.Count works all right, which returns 4. But I just don't understand why Excel.AddIns.Item[0] fails to return the first Excel.AddIn object. The API doesn't seem to say too much about it either. http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.addins.item read more
c#
excel
interop
vsto
add-in
2votes
3answers

Excel worksheet get item

I have a problem with Excel worksheet. I am trying to create an Excel file with c#. This code works and runs correctly on my computer but in other computers get an error at last line: Excel.Application xlApp; Excel.Workbook xlWorkBook; Excel.Worksheet xlWorkSheetInvoice; Excel.Worksheet xlWorkSheetInvoiceLine; object misValue = System.Reflection.Missing.Value; xlApp = [...] read more
c#
excel
office-interop
2votes
1answer

How to pass dateTimePicker Value to Crystal Report in c#?

I am want to pass datetimepicker Value to Crystal report to show rows Between those date i am using this code private void button3_Click(object sender, EventArgs e) { DateTime d1 = Convert.ToDateTime(this.dateTimePicker1.Value.ToShortDateString()); DateTime d2 = Convert.ToDateTime(this.dateTimePicker2.Value.ToShortDateString()); RPT.rpt_all_bocket_transaction myReport = new RPT.rpt_all_bocket_transaction(); myReport.SetParameterValue("@D1",d1); myReport.SetParameterValue("@D2",d2); RPT.frm_rpt myForm = new RPT.frm_rpt(); myForm.crystalReportViewer1.ReportSource = [...] read more
c#
crystal-reports
2votes
1answer

Working with Excel Worksheet in C#

I have a Excel version problem with an Windows Forms Tool. Microsoft.Office.Interop.Excel.Worksheet ws = myExcelWorkbook.Worksheets[3]; ws.Delete(); ws = myExcelWorkbook.Worksheets[3]; This works perfectly with Excel 2010 but throws the following Exception in > Excel 2013: "0x8002000B DISP_E_BADINDEX" read more
c#
.net
excel
ms-office
2votes
3answers

Exe file Error HResult 0x8002000B, Invalid Index

> Possible Duplicate: > How to run a C# .exe file on many computers? I have a problem with my executable file. I made in C# windows forms to convert from txt to excel. Then in debug i took exe file there. In my computer with .NET 40 and Excel [...] read more
c#
indexing
exe
hresult
1vote
0answers

Accesing sharepoint excel using powershell/python

I am trying to copy excel sharepoint data and manipulate it using powershell or python. I tried the below code for powershell $fromfile = "https://company.sharepoint.com/:x:/r/personal/username_domain_company_com/................. Changes.xlsx" $tofile = "C:\ExcelTest\NewExcel.xlsx" $webclient = New-Object System.Net.WebClient $webclient.UseDefaultCredentials = $true $webclient.DownloadFile($fromfile, $tofile) $Excel = New-Object -ComObject Excel.Application $Workbook = $Excel.Workbooks.Open($tofile) $Worksheet = $Workbook.Sheets.Item($WorksheetName) $Excel.Visible [...] read more
powershell
1vote
1answer

how to add multiple sheets to excel file

i am adding multiple sheets to excel but it shows the exception System.Runtime.InteropServices.COMException: 'Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))' . the exception occurs at Position: xlWorkBook.Sheets("105") Dim xlApp As Excel.Application Dim xlWorkBook As Excel.Workbook Dim xlWorkSheet105 As Excel.Worksheet Dim xlWorkSheet120 As Excel.Worksheet Dim xlWorkSheet125 As Excel.Worksheet Dim xlWorkSheet600 As [...] read more
excel
vb.net
worksheet
1vote
1answer

Invalid Index. Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX) when Workbooks.Open

I am trying to make an app that will open an xlsx file for reading, and than read it and do some stuff with it. When I run my app, and click a button to load the file, I am getting this error: > Invalid Index. Exception from HRESULT: 0x8002000B [...] read more
c#
excel
1vote
5answers

Crystal Report Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I have made a crystal report in asp.net for web application. Some report open nicely. But sometimes it does not. It shows the following problem. > Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) > Description: An unhandled exception occurred during the execution of the > current web request. Please review [...] read more
asp.net
crystal-reports-2008
1vote
2answers

Crystal Report: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I can not pass values to the report. This is my code: public void GLRPT() { try { ReportClass rptH = new ReportClass(); rptH.FileName = Server.MapPath("~/Rpts/G1.rpt"); rptH.Load(); string df = Session["fromdate"].ToString(); string dt = Session["todate"].ToString(); DateTime fromdate = DateTime.Parse(df); DateTime todate = DateTime.Parse(dt); rptH.SetParameterValue("?Date_From", fromdate); rptH.SetParameterValue("?Date_To", todate); rptH.ExportToHttpResponse(ExportFormatType.PortableDocFormat, System.Web.HttpContext.Current.Response, false, [...] read more
asp.net-mvc
database
crystal-reports
1vote
1answer

How to solve Crystal report Error as "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))"?

Hai i got error in wpf crystalreports while loading with dateparameters as "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))",how to solve this? string dfrm1 = ""; string dto1 = ""; DateTime dateTime1a = datePicker1.SelectedDate.Value; dfrm1 = string.Format("{0} {1}:{2}:{3}", dateTime1a.ToShortDateString(), 00, 00, 01); DateTime dateTime2a = datePicker2.SelectedDate.Value; dto1 = string.Format("{0} {1}:{2}:{3}", [...] read more
c#
wpf
crystal-reports
crystal-reports-2010
1vote
2answers

Passing textbox value to crystal report

I have an error when passing my TextBox value to my Crystal Report: System.Runtime.InteropServices.COMException(0x8002000B): Invalid index. (Exception from HRESULT: 0x8002000B(DIS_E_BADINDEX)) at CrystalDecisions.ReportAppServer.DataDefModel.FieldsClass.get_Item(Int32 Index) at CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions.get_Item(Int32 Index) at CrystalDecisions.CrystalReports.Engine.ParameterFieldDefinitions.get_Item(String fieldName) at WindowsFormsApplication1.Form15.button1_Click(Object sender, EventArgs e) in ..\Form15.cs: line 134 this is my code for getting my entered values in my textboxes [...] read more
c#
visual-studio-2010
crystal-reports
1vote
0answers

BindToMoniker Gets Two Windows then Windows(wb.Name).Visible Fails

I'm trying to get an Excel file using BindToMoniker. For this question I'm starting with the no running instance of Excel (no workbooks open). It opens one Excel instance with two Excel windows shown. The one is entitled Excel and the other is titled with my workbook name. Neither of [...] read more
vb.net
excel
vba
1vote
1answer

Can't programmatically access a specific options page in Visual Studio

I can't seem to access the properties in Visual Studio's options programmatically. Specifically, I have an extension that I need to leverages TFS power tools. I would like to get the value of the folder where the Work Item Templates are stored. Going into the options they are stored at [...] read more
visual-studio-2013
visual-studio-extensions
vsix
vsx
vspackage
1vote
0answers

Crystal Reports: Need To Add A New Data-Linked Field To Table

I've recently been revising a report we've been using for years in Crystal Reports 9, a Traveler which displays job information from JobBOSS. I have had a little experience in the past with customizing reports, and this time around I've learned a lot, however, one thing I need to do [...] read more
crystal-reports
field
add
1vote
0answers

Pass a value from WinForm to Crystal Report

I used this code to pass a value from DatagridviewCell to Crystal Report FormulaField: CrystalReport6 objRpt6 = new CrystalReport6(); for (int i = 0; i < statistiqueDataGridView.RowCount; i++) { objRpt6.DataDefinition.FormulaFields["CodeBonLivraison11"].Text = "'" + statistiqueDataGridView.Rows[i].Cells[0].Value.ToString() + "'"; } But I get this error message: > Invalid index. (Exception from HRESULT: 0x8002000B [...] read more
c#
winforms
crystal-reports
1vote
2answers

declare/open excel file in vb.net

I've been trying for a while to declare or to open a excel sheet in vb.net. I already read excel file in vb.net and other links but it doesn't work. I added Microsoft Excel 12.0 Object Library. I included: Imports Microsoft.VisualBasic Imports System.Net.Mime.MediaTypeNames Imports Microsoft.Office.Interop I want to declare / [...] read more
vb.net
excel
file-io
1vote
2answers

How to iterate over all the page breaks in an Excel 2003 worksheet via COM

I've been trying to retrieve the locations of all the page breaks on a given Excel 2003 worksheet over COM. Here's an example of the kind of thing I'm trying to do: Excel::HPageBreaksPtr pHPageBreaks = pSheet->GetHPageBreaks(); long count = pHPageBreaks->Count; for (long i=0; i < count; ++i) { Excel::HPageBreakPtr pHPageBreak [...] read more
c++
excel
com
vba
1vote
2answers

Excel Worksheet name error

Dim xl As New Excel.Application Dim xlBook As Excel.Workbook = xl.Workbooks.Open(myExcelFileName) Dim xlSheet As Excel.Worksheet = xlBook.Sheets("Sheet1") So I have the above code that open excel file to perform some operation later, The problem is sme sheets contain space in there names for example "sheetx " And when trying to [...] read more
vb.net
windows
excel
1vote
1answer

Exporting Data From Multiple DataGridViews on a Form to Multiple Excel Sheets in a Single Excel File

I have a Database Application in which it has multiple dataGridViews on the Form. I am able to successfully export a single grid view to an Excel sheet but I would I would like to export the grid to different Excel sheets in a single Excel file. I tried the [...] read more
c#
winforms
excel
excel-interop
1vote
1answer

Unable to Catch COMException ( VB.net Excel workbook.styles)

I'm using VB.net in MS Visual Studio 2012 to create an add-in for Excel (2010, 2007). The add-in uses Excel's Styles to format reports. Rather than iterate through the Styles collection, I thought it would be easier to try getting a reference to my style by name and catch the [...] read more
vb.net
styles
try-catch
excel-interop
comexception
1vote
0answers

Add a column to a VSTO ListObject that has an existing data source?

Does anyone know how to add a column to an existing list object in Excel, one that has already got a data source bound to it from a SQL source? I just want to add another column with a formula in every cell for that column of data, to match [...] read more
vb.net
winforms
excel
vsto
1vote
2answers

Visual Studio 2010 AddIn DTE2 not working

I am trying to create an AddIn in Visual Studio 2010 like below: public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom) { _applicationObject = (DTE2)application; _addInInstance = (AddIn)addInInst; EnvDTE80.Windows2 wins2obj; AddIn addinobj; object ctlobj = null; Window newWinobj; // A toolwindow must be connected to an add-in, [...] read more
visual-studio-2010
visual-studio-addins
0votes
1answer

excel interop exception 0x8002000B

I have the following code to open a workbook and keep just one sheet: //Get a new workbook. oWB = app.Workbooks.Add(Missing.Value); int len = oWB.Sheets.Count; for (int i = 1; i < len; i++) { ((Worksheet)oWB.Sheets[i]).Delete(); } oSheet = (Microsoft.Office.Interop.Excel.Worksheet)oWB.ActiveSheet; This code has worked for many years in many client [...] read more
c#
.net
excel
office-interop
0votes
1answer

How to Split One Excel Sheet into many Sheets According to its Criteria

I want to split one worksheet which has a column named Diameter into many sheets according to the number of diameters found, in my case it is Column C in a Master Sheet, My code is Private Sub Splitter() Dim xl As New Excel.Application Dim wb As Excel.Workbook Dim Source [...] read more
excel
vb.net
split
0votes
0answers

Code Working in VB 2013 And Not Working in VB 2019?

I have a code which is working very well in VB.Net 2013 and the same code (Copy & Paste) is not working in VB.Net 2019? I receive error > Invalid Index (Exception from HRESULT: 0X8002000B (DISP_E_BADINDEX)) The Error only shows with this Line Destination = CType(wb.Sheets(Diameter), Excel.Worksheet) wb is a [...] read more
excel
vb.net
0votes
0answers

Failed To Assign The IconSet Property In A FormatConditons

I am trying to automate the conditional format of a range and only accept three types of icons. The routine is in the click event of a button. The code works as long as the value of the variable is less than or equal to three, variables xl3arrows, xl3arrowsgray, xl3flags. [...] read more
excel
vb.net
vsto
0votes
1answer

Getting/setting Track Changes setting property value trough DTE in Visual Studio 2019

I have a Visual Studio extension that gets the value and then sets a value to the Text Editor -> General -> Track Changes setting in the Options dialog. A code that was working fine with Visual Studio 2012-2017: DTE vsEnvironment = (DTE)GetService(typeof(DTE)); Property trackChangesProperty = vsEnvironment.Properties["TextEditor", "General"].Item("TrackChanges"); is throwing [...] read more
visual-studio
envdte
visual-studio-2019
0votes
1answer

Why won't excel instances not quit

I am trying to delete named ranges from a bunch of excel files. Getting the following exception throws when the code is running: "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))" Tried everything thing I could think of but excel instances just won't quit! Please see the code pasted below. Interop [...] read more
c#
excel-interop
0votes
1answer

Perl Copy data from csv to excel workbook

I am trying to open a csv file and copy the data from within it to paste it into a tab in an already constructed excel (2016) workbook. my problem appears to be accessing the csv file properly. Here is my code use utf8; use Cwd; use warnings; use strict; [...] read more
excel
perl
csv
win32ole
0votes
0answers

Pass parameter value from mvc controller to crystal reports

Good day. It may be a noob question but ow do you pass a parameter from controller to crystal reports? I am kinda new when it comes to crystal reports. Controller ReportDocument rd = new ReportDocument(); rd.Load(Path.Combine(Server.MapPath("~/Reports"), "Mtop.rpt")); SqlConnection cn = new SqlConnection("Data Source=test.tayabas.gov.ph;initial catalog=iVehicles;User ID=sa;Password=TEST@dm!n!@#$%;MultipleActiveResultSets=True;Application Name=EntityFramework;"); SqlCommand cmd = [...] read more
crystal-reports
0votes
1answer

Inserting data into multiple worksheets on a single excel workbook

I am working on a method which exports data from two different C# lists into two excel worksheets in a single workbook using the following code Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application(); Microsoft.Office.Interop.Excel._Workbook workbook = app.Workbooks.Add(Type.Missing); Microsoft.Office.Interop.Excel._Worksheet worksheet1 = null; worksheet1 = (Microsoft.Office.Interop.Excel._Worksheet)workbook.Sheets["Sheet1"]; worksheet1 = (Microsoft.Office.Interop.Excel._Worksheet)workbook.ActiveSheet; for (int i = 1; [...] read more
c#
excel
list
interop
0votes
1answer

Excel side by side comparison with C# Excel Interop

Attempting to load two Excel workbooks side by side with C# using Excel interop. I've tried a variety of ways, but I have been unable to get this to work. I've gotten it to work with Word documents. Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application(); ExcelApp.Visible = true; Microsoft.Office.Interop.Excel.Workbook doc1 = ExcelApp.Workbooks.Open(fileToOpen.ToString()); [...] read more
c#
excel
excel-interop
0votes
1answer

how to get excel sheet name using index c#

I am trying to import multiple excel workbook and bind it to datagridview as shown below my problem is I want to get sheet name using index to make this method fixable I am getting error that says I tried zero index I am get error too Invalid index. (Exception [...] read more
c#
.net
visual-studio-2013
.net-3.5
0votes
0answers

Issue with Copying Data from 100 Excel sheets into a Single Sheet

I am using the Powershell script to load data from about 5 Excel sheets (as a sample) from column A to AL. In reality, I have 100 Excel Sheets with 25 Tabs in each file. I have used the link How to use powershell to copy several excel worksheets and [...] read more
powershell
automation
excel-2016
0votes
4answers

c# delete excel sheets using for loop

I am trying to delete excel sheets using for loop except selected sheet by User using Dropdown menu in asp.net web application. So, I have written a code in c#. int index = DropDownList1.SelectedIndex; int max = DropDownList1.Items.Count; int i=3; for (i=1; i <= max; i++) { if (i != [...] read more
c#
0votes
1answer

Crystal Report Does not display properly - Invalid Index

I have a crystal report in my project. Whenever I am trying to open that page, This exception appear. > Crystal Report: Invalid index. (Exception from HRESULT: 0x8002000B > (DISP_E_BADINDEX)) In my Crystal Report, I have a Parameter Fields named isEffective (Boolean type). When I run the program and the [...] read more
c#
crystal-reports
0votes
0answers

Windows 8 vs Windows 10 with Microsoft.Office.Interop.Excel

I am trying to create some Excel sheets and then edit them. On Windows 8 it works as expected but when it is ran on Windows 10 it does not work. It breaks at xlWorkSheetEvt = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(sheetIndex); I get an COM exception that says there is a Index error(Exception from [...] read more
c#
exception
0votes
1answer

What is the another way to add two excel sheets in one workbook using vb.net

I am facing issue with excel reports during creation of two excel sheets ine one workbook using vb.net, I was using Microsoft Excel 2007 for report generation it was good but unfortunately I need to uninstall all Microsoft Office Components and then I installed WPS office.Then this problem arise during [...] read more
vb.net
excel
vba
0votes
1answer

Crystal Reports invalid parameter index?

I'm working with VB2010 C# and CR13. I've created a report with empty parameter fields that I'll fill during runtime using the texts that the user will enter on multiple text boxes. I've created a dictionary that contains the parameter name as the key and the text as value. Dictionary<String, [...] read more
c#
visual-studio
crystal-reports
comexception
0votes
0answers

System.Runtime.InteropServices error when exporting dataGridView to Excel workbook

I have an application that displays certain database data, and includes a function to save that data to an excel workbook on request using the Microsoft.Office.Interop.Excel assembly. One of my users reports the following error when trying to save to an excel workbook: System.Runtime.InteropServices.COMException (0x8002000B): Invalid index. (Exception from HRESULT: [...] read more
c#
runtime-error
office-interop
0votes
0answers

Change text object crystal report during run time with vb.net

I have problem with crystal report. This is the scenario. I want to print to printer from vb.net --> crystal Report --> Printer. There is one blank field called DOType. When i run the program, i want to print with 1 Original (blank field called DOType was changed into "ORIGINAL") [...] read more
vb.net
visual-studio-2010
crystal-reports
crystal-reports-2010
0votes
2answers

Excel (.xls file) - 4 sheets not possible?

need your help again! This Script doesn't work. It works for the first 3 Sheets, but doesn't work for the last one. If I switch the itemnumber (eg. 3->4 and 4->3) the new 3 works and the new 4 does not. Is this some sort of bug? Or am I [...] read more
excel
powershell
0votes
2answers

excel - .Copy() twice

I have a workbook that consists of 6 worksheets. I want to save sheet 2 & 3 With Excel .SheetsInNewWorkbook = 6 .Workbooks.Add() .... .Worksheets(2).Copy() filename = "1.txt" .ActiveWorkbook.SaveAs(filename, -4158) .Worksheets(3).Copy() filename = "2.txt" .ActiveWorkbook.SaveAs(filename, -4158) End With Upon copying the 2nd time, my application crash and return this error: [...] read more
vb.net
excel
0votes
1answer

Worksheets.Item / Worksheet.Cells properties working in unexpected way

Edit: Ignore - this is actually behaving this way because of some code outside the scope of this script. My mistake. I just submitted a request to close this post. I have a simple PowerShell script that is supposed to delete the first line from an Excel .xls file. My [...] read more
excel
powershell
etl
0votes
1answer

Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX) when pressing Ctrl-C in code editor

this happens in visual studio 2012 when pressing Ctrl-C on any text or code. it started happening after i installed Web Essentials Extension (although i don't think it is causing it)... even after removing it the error did not disappear. any help is appreciated. thanks. read more
visual-studio-2012
0votes
3answers

how to display Textbox values in the crystal reports?

i have a text box in the front end i want to display this textBox value along with my data table in CRYSTAL REPORT VIEWER. I have displayed data table value successfully , but found some hurdles to display textBox values. I am using Web Application(c#). Pls Help.. Thanks in [...] read more
asp.net
crystal-reports
0votes
2answers

Error Exporting to Excel C#

I'm getting an error when I'm exporting Excel to C#, I can't find where my code is wrong and the solution for my problem Error : > An unhandled exception of type 'System.Runtime.InteropServices.COMException' > occurred in GestãoSI.exe > > Additional information: Índice inválido. (Excepção de HRESULT: 0x8002000B > (DISP_E_BADINDEX)) The [...] read more
c#
0votes
1answer

exception HREsult 0x8002000b disp_e_badindex in Visual Studio 2008

I am exporting dataset to Excel. When trying with 3 Excel sheets, it is working fine. But if I try with a fourth sheet, it shows this exception. exception HREsult 0x8002000b disp_e_badindex Is there any answer for this? read more
c#
excel
exception
0votes
1answer

C#:Copy protected worksheet to another excel file

I was trying to copy paste one protected worksheet to another excel file but i`m getting error like > "Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))" C# Code: try { string startPath = System.IO.Path.GetDirectoryName( System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); string filePath = System.IO.Path.Combine(startPath, strPath); wBook = xCel.Workbooks.Open(filePath); wSheet = (Excel.Worksheet)wBook.Worksheets.get_Item(1); wSheet.Copy(Type.Missing, Type.Missing); wSheet = [...] read more
c#
excel
vba
0votes
1answer

Visual Studio.NET 2010 Error: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))

I was wondering if you have experienced this vague issue when trying to copy a text in visual studio.net 2010 SP1: > Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) I've got Git Extensions and NuGet add-ons installed. I've also tried opening vs.net running in administrator mode. Was wondering if anybody [...] read more
visual-studio-2010
git
nuget
0votes
2answers

Pass multiple values in crystal report

I am trying to pass 2 values that are generated from C# passed to MS SQL stored procedure through Crystal reports so far i have this code string username = Context.User.Identity.Name; string date = DateTime.Now.ToShortDateString() ; ReportDocument crystalReport = new ReportDocument(); crystalReport.Load(Server.MapPath(@"..\admin\CrystalReport1.rpt")); crystalReport.SetParameterValue("@Username", username); crystalReport.SetParameterValue("@Date", date); crystalReport.SetDatabaseLogon("", "", @"dennislaptop-pc\SQLEXPRESS", "healthylifestyledb"); [...] read more
c#
crystal-reports
parameters
0votes
2answers

Why does Perl's Win32::OLE complain about "Invalid index" for an Excel worksheet?

Code # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); # open Excel file my $Book = $Excel->WorkBooks->Open($file); # select worksheet number. Default is 1 (you can also select a worksheet by name) print "worksheet $worksheet\n"; my $Sheet = $Book->Worksheets($worksheet); where $worksheet is [...] read more
windows
perl
excel
0votes
2answers

Crystal Reports problem

I'm having problem in the following line: rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman; it throws an exception saying HRESULT: 0x8002000B (DISP_E_BADINDEX)) if I skip this line, the same error eccurs here: rd.PrintOptions.ApplyPageMargins(config) Did anyone have this problem before? thanks! read more
crystal-reports
-1votes
1answer

Split Worksheets By Criteria VB.Net

I want to split worksheets with Diameter Criteria in Column C in a Master Sheet, My code is Private Sub Splitter() Dim xl As New Excel.Application Dim wb As Excel.Workbook Dim Source As Excel.Worksheet Dim Destination As Excel.Worksheet Dim SourceRow As Long Dim Lastrow As Long Dim DestinationRow As Long [...] read more
excel
vb.net
split
interop
criteria

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0