Missing Reference when using the Excel Library with Microsoft visual studio 2012 - excel

I am using Visual studio 2012 with MySql database .. I am trying to generate simple report using Forms. When click on button the reports will generate in EXCEL sheet. The problem that I am facing is using this library: using Excel = Microsoft.Office.Interop.Excel; when I used it says : One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?
as shown in the figure !!
Please Any Help ??
Thanks in Advance

I have sort out the problem :)
A default project in Visual Studio 2010 should have references to Microsoft.CSharp and System.Core.
In 2012, If they are not referenced in your project you need to add them, and the errors will go away.
Thanks

Related

Excel.QAT file from Excel2007 to Office365. .QAT replaced by OfficeUI?

I'm trying to migrate a QuickAccessToolbar in Excel 2007 to a new machine running Office365. It seems (web searches haven't been any help) that Microsoft has changed the parameter files from xx.QAT to OfficeUI and the location is different.
There is no "IMPORT/EXPORT" function in Excel 2007 in the QAT which is the standard method of migrating the settings.
Any help is appreciated. Happy New Year.
Solution found on social.technet.microsoft.com
I just upgraded from 2007 to 2010. Thanks for the help, I spent
months building my QAT, glad to have it back. My method was very
similar:
In Computer A only, navigate to:
C:\Users\%username%\AppData\Local\Microsoft\Office\ Create a copy of
Excel.qat;
Rename copy to: Excel.officeUI;
Restart Excel 2010, done.
I also did the same thing to Word and PowerPoint while there.
https://social.technet.microsoft.com/Forums/office/en-US/5064ddb6-b6b3-462a-ace9-7dd937a278ae/migrating-excelqat-2007-file-to-office-2010?forum=officesetupdeployprevious

Read/Write Excel files Visual Studio 2017

I just installed Microsoft Office 2010 (I'm guessing this has some references the program needs), and I'm using Visual Studio Community 2017, what reference do I need to add to write and read .xslx files?
Edit:
The Microsoft Excel 14.0 reference just appeared on the COM list, but I still can't make a file. I'm guessing I need to import something now?
This assumes you actually got the reference added as you state.
So then add this at the top of the code window
Imports Microsoft.Office.Interop
and this in your code:
Dim objApp As New Excel.Application
objApp.Visible = True
https://support.microsoft.com/en-us/help/302094/how-to-automate-excel-from-visual-basic--net-to-fill-or-to-obtain-data
I'm using vb.net (Visual Studio 15) and have MS Office 16, and when I added the COM reference Microsoft Excel 16.0 Object Library to my project, it didn't take. I actually had to browse (in the add reference window) to the following location an add a dll:
C:\Windows\assembly\GAC_MSIL\microsoft.office.interop.excel\15.0.0.0_71be9bcellle9429c\microsoft.office.interop.excel.dll

SSAS 2012 visual bug?

Has anyone else seen this? missing dsv
Normally when you are looking at a DIM in SSAS you have three sections to work in.
1) Attributes: These are the values you are including in your model
2) Hierarchys: If you build a hierarchy here is where it is viewed
3) Data Source View: This shows the source of the DIM and all the attributes loaded into the DSV are included.
Why is my DSV box empty?
I'm using TFS source control. I've deleted the local project and repulled the latest version but I'm still seeing this issue.
I'll submit an offical bug on microsoft's website.
If you have seen this how have you fixed it? I need to add new attributes to my DIM and I can't do that if I can't see the source table in the DIM...I'd prefer to not have to recreate ever DIM because of some bug.
I found a solution to this if anyone else comes across it. It has to do with having more than one version of Visual Studios installed on the server at a time and using different versions.
This article goes into detail on the issue. The article talks about changing the XLM code for the .dsv file and the .cube file. Specifically for the DIMs you will need to change the code there as well. Quite annoying...at least there is a way to fix it.
https://blogs.msdn.microsoft.com/sqlblog/2015/06/10/ssas-dsv-com-error-from-ssdt-ssas-design-data-source-view/
TLDR: VS 2012 and VS 2014 conflict with each other with their dll files. You will need to go into the XML code and change the leading binary string to the version of VS that you want to use.

import tag field from excel to TFS 2012

I am unable to import tag field from excel to TFS 2012. there are two ways currently to import into TFS from Excel:
If we export data from TFS to get a Template structure, TAG field would be read only. So user cannot make any changes to it.
If we use simple Excel where field names in TFS are given as column names and we try to migrate that data using TestCase migrator Plus tool (for Bug or TestCase work item in TFS), then it gives this WARNING: Value of Field: Tags is modified from 'Sanity' to ''
So eventually that TestCase or a Bug work item gets imported in TFS but WITHOUT TAGS field.
Kindly suggest me on this.
Thanks in advance
TFS 2012 does not support editing Tags in Excel.
This capability was introduced recently, in TFS 2013 Update 2. See here for more info: http://blogs.msdn.com/b/bharry/archive/2014/02/05/vs-tfs-2013-2-update-2-ctp-released.aspx

Declaring early bound MSXML object throws an error in VBA

I am trying to import xml data into excel..
So the first line of the code is
Dim XMLDOC As MSXML2.DOMDocument
and this gives an error "user defined type not defined"
Inside the VBE, Go to Tools -> References, then Select Microsoft XML, v6.0 (or whatever your latest is. This will give you access to the XML Object Library.
Updated with fancy pic!
I had DOMDocument defined which needed Microsoft XML, v3.0 but I had Microsoft XML, v6.0 selected in references which caused the below error
"user defined type not defined".
The solution
The solution was to either change DOMDocument to DOMDocument60 (60 uses ver 6.0) or use the Microsoft XML, v3.0 reference with DomDocument.
Just a quick note, if anyone is using a different version, such as Microsoft XML, v4.0, then DOMDocument40 should be used. This is because the number at the end of the DOMDocument is specific to the version of the library being used.
I work with a VBA Excel Macro that someone else wrote and I was tasked with fixing it after recently upgrading from Windows 7 / Office 2010 to Windows 10 / Office 2016. I started to receive the same "user defined type not defined" compile error. My previous install also had MS XML v6.0 but apparently you have to specifically point to this version in your code on Windows 10 and/or Office 2016 (I wasn't able to confirm which upgrade caused the issue). I was able to resolve the issue by doing a Find/Replace on the following:
"DOMDocument" to "MSXML2.DOMDocument60"
"XMLHTTP" to "MSXML2.XMLHTTP60"
I am using Microsoft Windows 10 & Office 2016.
Using Microsoft XML 6.0 does not fix the problem.
Selecting Microsoft XML 3.0 fixed the compilation error
I had the 3rd and 6th versions installed, and the project uses the 4th one. I installed the 4th version from https://www.microsoft.com/en-us/download/details.aspx?id=15697 and this solved the problem.

Resources