excel

How to detect the language of MS Excel from C#

If i try to use Excel from C# (interop) i receive error (HRESULT: 0x80028018) when current thread language is different from Excel language: so i need to set thread language, they must be the same. Which is the best method to understand the language of Excel/Office? 1) registry (HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\L...

MS Excel 03 - Deleting rows that have live string identifiers in column A, while concatenating other values

I have this xml document that is provided as a data feed (right off the bat I can not modify the source of the data feed) and i import it into excel with the xml import. there is no schema that comes with this xml so i get a table that ends up having a whole bunch of duplicates for an identifier, because of the unique values spread throu...

vba: read only first 1000 characters of file into string

i need to open a txt file and read it into a string in VBA, but i would like to only get the first 1000 characters. the file itself is 20mb and i only need the first 1000 characters. is there a way to make this efficient? ...

vba: get location of current worksheet

i wrote a macro that is an add=in it needs to figure out the location of the current worksheet on which it is being executed. how do i do this? i need the file location (directory) ...

running a macro from an add-in

i have an add-in called book1. inside the addin there is a module called module1 which has a sub called addin1 i would like to run the macro addin1 from a different workbook i am trying to call this macro like this: Call Addin1 but that's not working and i tried: Call book1.xlam.Module1.AddIn1 which is not working either does a...

Best way to provide Excel like WebPage?

Hi everyone, is there in any means a manner to show a grid or something like Excel. I see alot of information, but how do you feel about this one? Are there grids, or third party grid that provide these features? Thanks, I very like it to here your opinion, and your idea about this feature I want to provide in a Web Page? ...

Can someone confirm how Microsoft Excel 2007 internally represents numbers?

I know the IEEE 754 floating point standard by heart as I had to learn it for an exam. I know exactly how floating point numbers are used and the problems that they can have. I can manually do any operation on the binary representation of floating point numbers. However, I have not found a single source which unambiguously states that e...

Is it possible to create an efficient UDF alternative to Excel's CUBEVALUE function?

We'd like to create a simpler alternative to Excel's CUBEVALUE function for retrieving data from an OLAP server. The details aren't critical, but briefly, our function will "know" the source connection and accept a very simple ticker-like parameter and a date, in place of CUBEVALUE's MDX-style parameters. This is for internal use within ...

Python and Excel - check if file is open

hey guys, I need help considering win32com in Python: I have a routine that opens a Workbook, creates a sheet and puts some data on it. If everything runs fine the woorkbook is saved and closed - If not the python session is terminated but the woorkbook is left open. So the reference is lost. Now when restarting the code Excel prompts yo...

Excel - referenced values via OleDB from .Net client

I'm trying to read an Excel file (.xls, I think Excel 2003 compatible) via OleDB, but it fails to get the values for referenced fields. This is my current test code (please note, this is just part of the class): Private m_conn As OleDbConnection Public Sub New(ByVal fileName As String) Dim connString As String = String.Format("Pro...

Powershell interact with open Excel

To interact with excel in Powershell it is common to start a new excel as follows: $x = New-Object -comobject Excel.Application Instead of that I have an open Excel process already. (I get it as follows) $excelprocess = Get-Process | Where-Object {$_.name -eq "excel"} | Sort-Object -Property "Starttime" -descending | Select-Object -F...

excel vba: writing to mysql database

i would like to write a macro that will write to a mysql database. can someone please get me started on this? ...

connecting to mysql from excel: ODBC driver does not support the requested properties.

i am trying to add data to mysql from excel. i am getting the above error on this line: rs.Open strSQL, oConn, adOpenDynamic, adLockOptimistic here is my code: Dim oConn As ADODB.Connection Private Sub ConnectDB() Set oConn = New ADODB.Connection oConn.Open "DRIVER={MySQL ODBC 5.1 Driver};" & _ "SERVER=localhost;" & _ ...

what does select @@identity do?

i am connecting to a mysql database through excel using odbc what does this line do? Set rs = oConn.Execute("SELECT @@identity", , adCmdText) i am having trouble updating the database: With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields...

Conditional Formatting in Excel

I'm very new to Excel and VBA and was wondering if there is a way I could make conditional formatting based on values in a drop down list (created from data validation). I currently have a warning if the user enters something that is not valid (data validation), but I want to change the cell's background color to red if invalid, or gree...

how do i update database using ADODB.Recordset?

i am using excel to connect to a mysql database: Dim dpath, atime, rtime, lcalib, aname, rname, bstate, instrument As String Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset ConnectDB With wsBooks rs.Open "batchinfo", oConn, adOpenKeyset, adLockOptimistic, adCmdTable Worksheets.Item("Report 1").Select ...

difference between cn.execute and rs.update?

i am connecting to mysql from excel using odbc. the following illustrates how i am updating the rs With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = atime .Fields("reporttime") = rtime .Fields("lastcalib") = lcalib .Fields("ana...

why is ADODB inserting NULL values on update?

i have: With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = "atime" .Fields("reporttime") = "rtime" .Fields("lastcalib") = "lcalib" .Fields("analystname") = "aname" .Fields("reportname") = "rname" .Fields("batchstate") = ...

what does this ADO OPEN Method do?

in plain english can you explain to me what happens here: rs.Open "batchinfo", oConn, adOpenKeyset, adLockOptimistic, adCmdTable what i need to do is to be able to insert values into a table called batchinfo. would this be the best way to do an OPEN? the only thing i would be doing is inserting values. ...

ADODB: difference between ADDNEW and UPDATE methods?

i am updating a table in mysql using ADODB i am adding new entries into a table should i be using addnew or update? ...