I have a small program which creates Excel files from a database table, with Excel 2013 it works all fine, but i Need it now for Excel 2010 and now I get the following exception when i will add the "Format" to the NumberFormatLocal (range.NumberFormatLocal = format;) The same exception [...] read more
I have a requirement to modify the ms project file (.mpp) using C#.net. I have done with all the things, the only thing remaining is to modify the TimescaleStart date of MPP file using C#.net. I need to set the user defined date. How can i do that? Following is [...] read more
This is what happens: enter image description here [https://i.stack.imgur.com/RLZyM.png] xlValues is set as an Excel.Range object. I have tried the following as well, all giving me the same error: //xlValueRange = xlSheet... .get_Range("A1:A5,A15:A25,A50:A65"); .UsedRange.Range["A1:A5,A15:A25,A50:A65"]; .Range["A1:A5,A15:A25,A50:A65"]; xlApp.ActiveWorkbook.ActiveSheet.Range["A1:A5,A15:A25,A50:A65"]; //I have also tried these alternatives with ".Select()" after the brackets and //", Type.Missing" [...] read more
DirectoryEntryObject.Invoke("ChangePassword", new object[] { oldPassword, newPassword } ); throws the following error: > "System.Reflection.TargetInvocationException: Exception has been thrown by the > target of an invocation. > ---> System.Runtime.InteropServices.COMException (0x80020005): Type mismatch. > (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) > --- End of inner exception stack trace --- > at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, [...] read more
I have the following legacy VB6 function that I want to call from C#. Public Function CreateMiscRepayment(ByRef objMiscRepayment As MiscRepayment) As Variant ' Code that sets objMiscRepayment here End Function I'm using the following code in C# but getting an exception: dynamic vb6ComObject = Activator.CreateInstance(Type.GetTypeFromProgID(progId)); dynamic miscRepayment = null; dynamic [...] read more
I need to color Excel cells in a fast manner. I found similar method to write to Excel cells which for me is really fast, so I tried applying the same method when coloring the cells. Consider the following code: xlRange = xlWorksheet.Range["A6", "AS" + dtSchedule.Rows.Count]; double[,] colorData = new [...] read more
I have 2 variables in SSIS package as CurrFile of string and File_Dt of DateTime datatype. I want to extract DateTime from CurrFile and store it into File_Dt variable. For this I am using expression as below: (DT_DBDATE) SUBSTRING( @[User::CurrFile], 21,14 ) After doing SUBSTRING the value is 20190725001614. Now, [...] read more
I am getting the following error when trying to Save as Document Object while trying to implement a word automation in C#: > System.Runtime.InteropServices.COMException > > > (0x80020005): Type mismatch. (Exception from HRESULT: 0x80020005 > (DISP_E_TYPEMISMATCH)) > > at Microsoft.Office.Interop.Word.DocumentClass.SaveAs(Object& > > > FileName, Object& FileFormat, Object& LockComments, Object& Password, [...] read more
We recently finished development of a VSTO Outlook add-in. For some configuration data, it uses custom olText properties on a Folder. When our add-in detects that these properties are not available, it uses the UserDefinedProperties property of the Folder to Find/Add our custom properties if they don't exist. if (folder.UserDefinedProperties.Find(propertyName) [...] read more
I am facing a problem while making Excel's LinEST function. My program goes like MyExcel.Application xl = new MyExcel.Application(); MyExcel.WorksheetFunction wsf = xl.WorksheetFunction; List<int> x = new List<int> { 1, 2, 3, 4 }; List<int> y = new List<int> { 11, 12, 45, 42 }; object o = wsf.LinEst(x, y, [...] read more
I want to implement this method in my c# program. But I am having trouble filling in the appropriate parameters in a line like long FirstRow = myWorksheet.Cells.Find( What:="*", After:=Range("IV65536"), LookIn:=xlValues, LookAt:= xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Row Here is the documentation for the Range.Find method. Range Find( [In] object What, [In, Optional] [...] read more
I have a COM Interface which has function signature as mentioned below: Guid GetGuid2() It is implemented in a class: public Guid GetGuid2() { return Guid.NewGuid(); } Then this function needs to be used by Perl. my $dotNetLib = 'MyCOMDLL'; my $server = Win32::OLE->new($dotNetLib) || die "Unable to launch server\n"; [...] read more
I have Excel VBA code that calls Workbook.XmlImport() result=ActiveWorkbook.XmlImport( _ URL:=strXML, _ ImportMap:=Nothing, _ Overwrite:=True, _ Destination:=Range("$A$1") _ ) Note that the second parameter is Nothing -- no import map specified. When I try to move this to PowerShell, I don't know how to specify Nothing. $xl=New-Object -com Excel.Application; $wb=$xl.Workbooks.Add(); [...] read more
I'm working on an Excel Addon using VSTO. I've just run into a weird problem, if I try get a value from the CustomProperties it throws a COM exception and I have no idea why. Has anyone run into this? Here's the code I'm trying to use: CustomProperties properties = [...] read more
I'm writing an Excel Addin. One of a UDF in the addin is to set value to a selected cell by using Excel Automation in C++. In my code, I have no problem to get range, read value from selected cell, but when I try to set value to cell, [...] read more
I have a .NET assembly. It happens to be written in C++/CLI. I am exposing a few objects via COM. Everything is working fine, but I cannot for the life of me figure out how to return an array of my own objects from a method. Every time I do, [...] read more
The class mshtml.HTMLDocumentClass in Microsoft.mshtml.dll assembly has a method: public virtual void write(params object[] psarray); Avoiding the real question for a moment, what code would you use to call write()? Would you use: String html = "<html><body>Hello, world!</body></html>"; mshtml.HTMLDocumentClass doc; ... doc.write(html); or would you use: String html = "<html><body>Hello, [...] read more
I am trying to develop a C# COM server that is accessible to clients only via IDispatch. Some of the methods of my COM objects return an array of interfaces to other COM objects. When I attempt to do this using early binding, such as via the code provided in [...] read more
From examples on the net, I have cobbled together this script which I hope will save Word .doc files as plainText. It does not. First, the Word window appears when I have given $word.Visible = $False. Then, a dialog appears asking if I want to open a read-only copy. No [...] read more
I have a MFC COM server (ActiveX) and a MFC COM client. The server is build up from the following IDL: library SomeLib { importlib(STDOLE_TLB); [ uuid(some-guid), dispinterface ISomeIntf { methods: [id(1)] HRESULT Foo( ); } [ uuid(some-guid), coclass SomeClass { [default] dispinterface ISomeIntf; }; } The client is using [...] read more
Short version At runtime, I'm getting a type mismatch error from Microsoft.Office.Interop.Excel, because Visual Studio thinks this Interop .dll is also part of my assembly and it can't decide which of the two equally named types it's perceiving (XlYesNoGuess) to use as my second parameter of Range.RemoveDuplicates(object, XlYesNoGuess). Please help [...] read more
I am using Azure Information Protection Unified Labeling client to label emails. We are still using PGP in our environment and emails classified strictly confidential must be PGP encrypted. When the email is sent, I try to find out, how the email is classified and trigger PGP encryption, when the [...] read more
I'm currently implementing an QAxFactory based COM-Api and want to give some of the functions default parameters. However, this seems not to work since when I call said functions without these default parameters I receive an error (HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)). I found some advice about linking signals and slots within [...] read more
Good day everyone. I am a starting programmer in powershell and am trying to make a program input help desk calls into an excel sheet to import into the help desk ticketing system. My script: $excel_file_path = 'G:\IT\Helpdesk\Daily Calls.xlsx' ## Instantiate the COM object $Excel = New-Object -ComObject Excel.Application $ExcelWorkBook [...] read more
I am trying to pass a Dictionary from c# to vba but this error occurs System.Runtime.InteropServices.COMException: 'Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))' I also tried converting my list of string into vb collection but the same error occurs. here are my codes private void btn_macrorunner_Click(object sender, EventArgs e) { [...] read more
I have a VB.NET winforms app which uses an ActiveX control (ocx). Via interop, I have a reference to an object defined in the ocx and call various functions on it. This works ok for the most part. I had some issues with one function call causing a memory leak [...] read more
I have been reading some questions and can find information on creating scripts but none seemingly using the object type "Computer". Apologies if this is more suited to superuser. But this is still at the script level and as such I thought it would be best placed here. Here is [...] read more
I'm trying to set an array property in a COM object using Ruby v1.93. Marshalling an array from COM into a Ruby array just works, but not in the other direction. How do I marshall a Ruby array into COM? The property is contained in a .NET assembly: namespace LibForRuby [...] read more
My issue involves a word file which has a macro embedded from another company which we have to remove and then set a new data source path (xlsx spreadsheet). The macro must be removed because it already sets the data source which is not available anymore when we get the [...] read more
I'm upgrading an old vba app to a C# app. The app automates Solid Edge (cad 3D program from Siemens). I'm having trouble calling a specific method of the Solid Edge API. The method in question has a bunch of ref and out parameters, I only care about one, representing [...] read more
In my console application, I am trying to write something to and read it back from the CustomProperties of an Excel worksheet. I have a reference to the Microsoft.Office.Interop.Excel v14 assembly. At the line that calls the firstWorksheet.CustomProperties.Add method, I get an exception with the HRESULT 0x800A03EC. Below is the [...] read more
I am trying to search a Lotus Notes database from PowerShell and getting a "Type Mismatch. (Exception from HResult: 0x80020005 (DISP_E_TYPEMISMATCH)" At line 1: char:1. Set-up code: $notesSession = New-Object -ComObject Lotus.NotesSession $notesSession.Initialize() $notesDb = $notesSession.GetDatabase(..., ...) I get the errors when trying... $results = $notesDb.Search("text", $null, 0) $results = [...] read more
I'm trying to convert a Doc to PDF. There is an error after opening PDF Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application(); object _MissingValue = System.Reflection.Missing.Value; public void WordtoPdf_Input() //word to PDf conversion { string filename_doc=System.IO.Path.GetFileName(LblFleip.Text); string wordFileName = LblFleip.Text; string pdfFileName=string.Empty; appWord.Visible = false; appWord.ScreenUpdating = false; // Cast as Object [...] read more
I am trying to extract certain values from an .msi file with Powershell to help automate an installation. I came across a method involving calling InvokeMember() such as example 1 and example 2. I tried this myself with the following code - $windowsInstaller = New-Object -ComObject WindowsInstaller.Installer $mSIPath = $prereqComponent.getAttribute("msiFilename") [...] read more
After an afternoon of searching this problem has got me stumped! I'm writing a managed C++ application which needs to call some unmanaged code. This is the function I need to call: public: void Connect( [out] LONG* pCookieID, [out] LONG* pNumberOfStreams, [out] VARIANT* pMediaType ); And the documentation has this [...] read more
Yesterday I was trying to batch convert a group of PPTs into PDFs for a friend, and I decided to have a look at PowerShell, since it's been sitting on my HD for a while. Here's the code I've come up with. $p = new-object -comobject powerpoint.application # I actually [...] read more
I saw an article on creating Excel UDFs in VSTO managed code, using VBA: http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx. However I want to get this working in a C# Excel add-in using VSTO 2005 SE, can any one help? I tried the technique Romain pointed out but when trying to load Excel I get [...] read more
I'm working on Excel add-on I need to search Values on cell (selected by user) in Column (Selected by user) and write result in cell (selected by user) Ex: if cell A2 exist in column B in rows 5, 10, and 15 result in C2 must be 5,10,15 I Face [...] read more
I've inherited a piece of custom test equipment with a control library built in a COM object, and I'm trying to connect it to our Tcl test script library. I can connect to the DLL using TCOM, and do some simple control operations with single int parameters. However, certain features [...] read more
I've got some VB.net code and a custom Microsoft Word VBA macro. I'm trying to pass the VB.net instance into the macro so that i can run a function on that object from the macro. I can't seem to pass in the object from the VB.net code to the Macro. [...] read more
I am hoping someone can help me. Let me first state that I am a very amateur programmer. I have an IMAP email account within outlook. I want to take a single email folder within that account and ensure that all the messages in that folder within outlook are in [...] read more
Please see bottom edit for where I am currently at, thank you. I have created a pivot table that works fine when the pivot cache is defined as: Dim ptCache As Excel.PivotCache = mainHighway.PivotCaches.Add(SourceType:=Excel.XlPivotTableSourceType.xlDatabase, SourceData:=mainHighwayData.Range("a1:v7500")) My problem is that the number of rows changes from day to day, so I [...] read more
I want to port a certain function call to C#. The two lines are as follows: m_pBrowserApp->get_Document(&pVoid); m_pLayoutAnalyzer->Analyze4(pVoid, _variant_t(5L)); m_pBrowserApp is the ActiveX browser object and pVoid is its document property. I can get that by calling WebBrowserBase.ActiveXInstance.Document. However, I have no idea how to create a _variant_t(5L) in C#. [...] read more
I have an access table in 2007 that is linked to a sharepoint list. When a new record is added to the sharepoint list, the change does not get automatically reflected in the access table. If you right click on the linked table, there is an option to "refresh list" [...] read more
I'm inserting some items into a SharePoint 2007 list using the Lists web service. I'm trying to write some code to handle any errors reported in the response, but navigating the XML is not working as expected. I'm attempting to get a collection of Result elements, then check each Result's [...] read more
I'm building a custom scaffolder to use with MvcScaffolding. Trying to automate adding code to the beginning of a method, I came up with the following code: $codeElement = Get-ProjectType "MyType" foreach ($member in $codeElement.Members) { if ($member.Name -eq "CreateMappings") { $editPoint = $member.StartPoint.CreateEditPoint() # here's where it's crashing $editPoint.FindPattern("\{") [...] read more
I'm trying to call a c++ IDispatch interface with the following method definition: ATL HRESULT TestFunc(long Command, [in, out] long* pData, [in, out] BSTR* pString, [out, retval] long* pRC); // ... Type t = Type.GetTypeFromProgID( "IMyTestInterfce" ); Object so = Activator.CreateInstance(t); Object[] args = new Object[3]; args[0] = -8017; args[1] [...] read more
Long time stackoverflow reader, first time poster. Forgive me if I'm not asking a question correctly. I'm trying to use the VixCOM API with PowerShell. I don't have much experience with either. I am aware of VMWareTasks: C# VixCOM wrapper library & tools . I've used it with success, but [...] read more
i am facing an issue while trying to migrate the data from one list to other, the list is having custom columns which are of type "Single line of Text","Multiple line of Text","Person or Group","Datetime","Integer". i am getting the below error after execution of the statement "Web.ProcessBatchData" ..... The operation [...] read more
I want to be able to save an object to file, and then have another script pick up that object again and be able to use it. I run Export-Clixml -InputObject $object -Encoding UTF8 -Path $file to save the object to file, but if I run $object = Import-Clixml $file [...] read more
I am using ssis expression to add a day to a project parameter. Project parameter and out put variable both are string datatype. Please see below code SUBSTRING((DT_STR,30, 1252) DATEADD("dd",1,(DT_DBDATE)@[$Project::Proj_End_Date]), 1, 10) The above is working fine when date passed as "2017-03-10" but it is failing when the Proj_End_Date value [...] read more
The documentation is here: https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.tools.word.document.printout?view=vsto-2017 This will print the whole document: Word.Application ap = new Word.Application(); Word.Document document = ap.Documents.Open(@"C:\temp\file.doc"); document.PrintOut(); I thought I were on to something with this as it compiled but it didn't work: Word.Application ap = new Word.Application(); Word.Document document = ap.Documents.Open(@"C:\temp\file.doc"); Word.WdPrintOutRange printRange = new [...] read more
I have a problem when calling an OCX method using C#. OCX component is developed in C++. I get this error: "System.Runtime.InteropServices.COMException (0x80020005): Los tipos no coinciden. (Excepción de HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))\r\n en System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)\r\n en MFCActiveXControl1Lib._DMFCActiveXControl1.LeoCadena(IntPtr nombreFichero, IntPtr contenidoFichero, Int32 LongitudFichero)\r\n [...] read more
I am creating a Pivot Table programmatically in c#. the code fines when the Source data ( which is a sheet in excel). It works fine till the source sheets contains 65536 rows, more than that, an error appears which says > Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) This [...] read more
I have developed a powerpoint plugin to insert a line chart with markers This chart number of hours worked on each day for a given week. Program first adds a chart to a slide using AddChart2. Then adds data in the worksheet attached to the chart : Weekly data for [...] read more
I have a docx file which I would like to modify according to web user input. So, after the user submits the form on the web page, I need to modify the original docx file, and then download it to the user. I try to store the original file as [...] read more
I need to do a case insensitive search in an Excel document using Range.Find. I'm currently using the following command as an attempt do a case insensitive search for any email address returned by https://haveibeenpwned.com $Found = $WorkSheet.Cells.Find($SearchText, $null, "xlValues", "xlWhole", "xlByRows", 1, $false) #What, After, Lookin, LookAt, SearchOrder, MatchCase [...] read more
I am not sure why it's happening but I am stuck in a point when I am trying to Configure my AppPool with a Specific Account i.e. MSA or Service Account. I am running below script in PowerShell to do the configuration: Import-Module WebAdministration Set-ItemProperty IIS:\AppPools\AppPool -name processModel -value @{userName="$user_name";password="$password";identitytype=3} [...] read more
I followed the guide in this link: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/interop/how-to-access-office-onterop-objects Here is my code: string fname = "Inventory Report.xls"; var excelApp = new Excel.Application(); // Make the object visible. excelApp.Visible = true; // Create a new, empty workbook and add it to the collection returned // by property Workbooks. The new workbook [...] read more
I'm trying to call a method from an old VB DLL and getting this error: > An unhandled exception of type 'System.Runtime.InteropServices.COMException' > occurred in Microsoft.VisualBasic.dll Additional information: Type mismatch. > (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) This is a VB project using VS Community 2015. It successfully loads the dll [...] read more
I'm trying to write a script that can do a few basic keyboard and mouse events, and then 'open' the current Chrome window, and continue from there. The only problem is that I cannot find a way to bring the Chrome window to the foreground. The code works with simple [...] read more
I'm working with Adobe Acrobat SDK, and I am trying to clean up the COM calls by wrapping the InvokeMember call in an Extension method to make the code a bit more readable. The extension method I am trying to write is as follows: using System; using System.Reflection; public static [...] read more
I am in the process of assigning a footer to hundreds of word documents with their current filepath. Here is my code, which does the job: I plan to have $Word.Visible set to false, but it isn't for now for debugging purposes. This gets all the word docs in a [...] read more
Im using WinForms and i try to open MS Word document (with some help info) on button click from my form My code : using Microsoft.Office.Interop.Word; Microsoft.Office.Interop.Word.Application ap = new Microsoft.Office.Interop.Word.Application(); Document document = ap.Documents.Open(Resource1.sign_full); My .docx file is sign_full.docx. I added it to my project Resource1.resx file. Then If [...] read more
I'm getting error "Type mismatch" when trying to InsertBreak via Range using parameters (for instance, wdPageBreak or wdLineBreak). But it's ok, to InsertBreak parameterless. Am I the only one getting such a behaviour, or is it another Word API bug? //MS Word VBA Reference Set myRange = ActiveDocument.Paragraphs(2).Range With myRange [...] read more
I'm trying to invoke a method on a NativeObject, e.g.: nativeObject.invokeMethod("scrollRectToVisible", new DynamicObjectProxy(new Rectangle())); I came up with the idea to pass a DynamicObjectProxy as a method parameter as the "invokeMethod"-method of a NativeObject always returns a DynamicObjectProxy for non-primitive return types. However, the following exception arrises: com.hp.lft.sdk.GeneralLeanFtException: no object [...] read more
In C# VSTO for excel, When I use the Find method on very long strings I get: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) Any Ideas? read more
I would like to extract some Information out of Visio shapes using vb.net. Therefore I think shape.getFormulas is the best opportunity. By executing this line I get the error: > Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) (I read in other posts that there might be a problem if SID_SRCStream [...] read more
I'm trying to update a local admin account password. I don't want to pass the password in plain text, so i found a workflow (https://www.pdq.com/blog/secure-password-with-powershell-encrypting-credentials-part-2/) that will allow me to encrypt PW's. #Change password for TestAccount $User = 'TestAccount' $PasswordFile = "$PsScriptRoot\Password.txt" $KeyFile = "$PsScriptRoot\AES.key" $key = Get-Content $KeyFile $MyCredential [...] read more
As part of a legacy automation, we try to assign "c:\temp" to a COM object's property. var host = engine.Session.Hosts.Item[HostName]; host.TemporaryDirectory = TemporaryDirectoryPath; During the run, we saw a COMException - "Type mismatch...0x80020005..." It seems that the property is in typeof BSTR and have a default value "50". Can you [...] read more
I am using Visual Studio 2012 .NET 4.0 I have been tasked with moving an application from one system to another. Due to some hardcoded sever refences in the original I have been forced to revise some of the source which is probably vb6 (zero comments in the source). Visual [...] read more
I'm having an issue with my code. I am hoping to use PowerShell to open an Access file, then export a table to an Excel file. so far, this is my code. $MsAccess = New-object -com Access.Application $MsAccess.OpenCurrentDatabase('<Filepath>',$false) $MsAccess.Application.DoCmd.OpenTable("<TableName>") $MsAccess.Application.DoCmd.OutputTo('acOutputTable, "<TableName>" , acFormatXLS , "OutputName.xls", true') $MsAccess.CloseCurrentDatabase() $MsAccess.Quit() It will [...] read more
I am quite new dealing with COM libraries and so on and I have step into a problem that I don't know how to solve. I have a code in Python using a library that I would like to transform into Powershell. So I have a COM library I want [...] read more
I got an error when trying to open excel workbook: var workbook = Workbooks.Open(filePath) After that every time I've got: > Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH) What is interesting, when im using Thread.Sleep(2000) before "Open" function everything is working correctly: Thread.Sleep(2000); var workbook = Workbooks.Open(filePath) Code is running on main [...] read more
I have a VB.net program that I wrote and have used hundreds of times. Whilst using Windows 7 I "upgraded" to Office 2010 and IIRC had to make a few small changes to get it to work. I have now (and again I put it in quotes as I fail [...] read more
I'm trying to call a macro of my Excel worksheet (2003) from my C# application with the C# Interop. It worked fine before with Integer parameters. But now I need to pass an Array of Integers and I keep getting a type mismatch exception. COMException: Type mismatch. (Exception from HRESULT: [...] read more
I have a number of SSIS packages which I have deployed to SQL Server 2014. The packages take a file parameter which I place into a variable. From that rawFile variable a number of variables are derived. The packages are running fine in my development environment and are providing me [...] read more
After searching a bit I still haven't got what I need. I'm trying to convert various files to PDF using VB.Net and referencing various MS Office components like Word/Excel/PowerPoint as either COM objects or by using the PIA (Office Interop Assemblies). In the end I want to use the COM [...] read more
Excel sorting requires specifying values in the format: Columns("A:C").Sort key1:=Range("C2"), order1:=xlAscending, header:=xlYes How Do I send it via tcom? I have tried the following unsuccessfully (Users) 14 % set sort [$worksheet Sort] ::tcom::handle0x0201DD00 (Users) 15 % $sort Header xlYes 0x80020005 {Type mismatch.} (Users) 16 % $sort Header 1 (Users) 18 [...] read more
I am trying to create a new Powerpoint presentation with Powershell from scratch but am having trouble with the object model. Based on some code from the ScriptingGuy I came up with: Add-type -AssemblyName office $Application = New-Object -ComObject powerpoint.application $application.visible = [Microsoft.Office.Core.MsoTriState]::msoTrue $slideType = "microsoft.office.interop.powerpoint.ppSlideLayout" -as [type] $blanklayout = [...] read more
I am trying to delete more than one column in my excel sheet. For Each lvi In ListView1.Items If lvi.Checked = True Then arrayLetters = lvi.SubItems(1).Text & ":" & lvi.SubItems(1).Text & "," & arrayLetters End If Next arrayLetters = arrayLetters.Substring(0, arrayLetters.Length - 1) Dim rg As Excel.Range = xlSheet.Columns(arrayLetters) rg.Select() [...] read more
I try to use the ExportAsFixedFormat in PowerPoint 2007 from a PowerShell 2.0 script. Only the first two arguments are required, but that won't work. I always get: > Exception calling "ExportAsFixedFormat" with "2" argument(s): "Type mismatch. > ( Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))" I've read that all arguments have [...] read more
We are trying to upgrade our TFS2012 to TFS 2013, however we receive the error-message: Error : TF400534 : Package (updatetfs) caching failed with the following status : 0x80070005 We have administrative rights, enough disk space and have tried both with web-installer and ISO-file. We believe that we meet all [...] read more
I am working on the easiest way to copy security settings from one server to another, using Powershell, and I'm curious if it's possible to import and entire group, including it's Description and Members properties? Below is the script I currently have. It appears that I can access the local [...] read more
After i convert code from word to PDf if i input the same word document to convet to PDf the PDF File is damaged. Can you tel me whether this error is because of inputting same word PDf many times or other error. Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application(); object _MissingValue [...] read more
I am trying to use UPnP(windows sys upnp.dll) with C# but I am having some troubles to figure out how to call UPnPService.InvokeAction. When I call the code below piece of code: string[] inarr = new[] { "", ""}; object outarr = new object[0]; object rvalue = myservice.InvokeAction("GetCompatibleUIs", inarr, ref [...] read more
What could be causing the error > Soapmapper: converting data for soapmapper failed inside the typemapper > HRESULT=0x80020005: type mismatch when running the code below? 's is a valid XML xml_doc.LoadXML s Dim Nds As MSXML2.IXMLDOMNodeList Set Nds = xml_doc.ChildNodes Dim module As clsws_ProfileManagement Set module = New clsws_ProfileManagement Set [...] read more
I have a dtspackage which is executed through the C# coding.Earlier we have used sql server 2008 r2, Now we have moved to sql server 2012. The package was working fine with sql server 2008 while executing through C#code.But now while loading the Config file it throwing the exception like [...] read more
After determining a row index for an Excel Worksheet, InsertRow, I would like to insert 16 rows after it using VB.net. I am building a COM add-in if that changes anything. In VBA I would do this via: ... Dim InsertRow as String ... Dim ContractForm As Worksheet Set ContractForm [...] read more
I'm fairly new to Powershell and found the following script on the web: (I've modified it for my project) # Acquire a list of DOC files in a folder $Word = New-Object -ComObject word.application $formats = "Microsoft.Office.Interop.Word.WdSaveFormat" -as [type] $Word.visible = $false $fileTypes = "*.docx","*doc" $complyDocPath = "i:\2014\COMPLY\DOC\" $complyPDFPath = [...] read more
I have the following code to copy data between 2 different excel files xlRangeSource = xlsheetSource.Range("B2:K" & IntAmountOfRows) xlRangeTarget = xlsheetTarget.Range("A" & intStartOfEmptyRow) xlRangeSource.Copy(Destination:=xlWbTarget.Worksheets(xlsheetTarget).range(xlRangeTarget)) IntAmountOfRows and intStartOfEmptyRow are both integers When executing my code, I get the following error: Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH)) However, I am using [...] read more
I want to create a MS Word merge document. I have already created a template document. When my application is started, it creates an ODBC, called "Hrms2008". I am new to this kind of stuff, that's why I don't know what causes the error. word.Application wrdApp; word.Document wrdDoc; object oMissing [...] read more
We are trying to get values returned from a COM object, the function is: bool AxSB100BPC.GetEnrollData(int dwMachineNumber, int dwEnrollNumber, int dwEMachineNumber, int dwBackupNumber, ref int dwMachinePrivilege, ref object dwEnrollData, ref int dwPassWord We are calling this function as: vRet = axSB100BPC1.GetEnrollData(mMachineNumber, vEnrollNumber, vEMachineNumber, vFingerNumber, ref vPrivilege, ref oglngEnrollData, ref glngEnrollPData); [...] read more
I am trying to save the document which i have opened through C#, I have kept the TrackRevision property of document interface also. Now I want to get the name of the person who has modified the document.In MS word I can find the name of the user from the [...] read more
When i run this code in the editor it works perfectly: (not a single error) $vm = 0 $vpc=new-object –com VirtualPC.Application –Strict foreach ($vm in $vpc.VirtualMachines){} $broken = Get-WmiObject Win32_PnPEntity | where {$_.ConfigManagerErrorCode -ne 0} $usbDevice = $vpc.USBDeviceCollection | ? {$_.DeviceString -eq $usb} | select -first 1 $vm.AttachUSBDevice($usbDevice) when i [...] read more
I am trying to incorporate Aspose Cells for .NET into this class that is using Excel Interop (rather than rewrite the whole thing to use Aspose Cells, which I am just now trying out, I want to at least start with a hybrid approach). The problem is that I get [...] read more
In a web application i have to implement a method to convert a doc/docx to a PDF. This is how i am doing it: FileInfo FILE = new FileInfo(path + filename); object missing = System.Reflection.Missing.Value; object readOnly = false; object objfilename = (object)FILE; //Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application(); try { [...] read more
I am having a problem with my app when trying to run on the server. In my place it works fine but when passed to the server it fails to try to create the pivotcache. Excel has permissions on the server with the user IIS, on my computer I have [...] read more
I am running a .exe that i pass an argument to, using Office.Interop v15. It works fine on the dev machine which is windows 7 with Office 2013. When i move to a VM that is running Windows XP and Office 2010, i get a run time error stating > [...] read more