Solved

Update Excel Spreadsheet where value is blank not working

Posted on 2013-05-28
2
241 Views
Last Modified: 2013-05-29
Hi,

The code below does not work... How to I check if Payer Claim Number is blank?   It works if I add a real value but that's the problem i'm facing.

Thanks
~j

        Dim path = "C:\Users\A303375\cc\ICD10\files\Sample Alternative Approach ICD10 Claims Data_UW_BACKUP.xlsx" '"c:\users\a303375\Desktop\Book1.xlsx"
        Dim connStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;"
        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim myCommand As New System.Data.OleDb.OleDbCommand
            Dim sql As String

            MyConnection = New System.Data.OleDb.OleDbConnection(connStr)
            MyConnection.Open()
            myCommand.Connection = MyConnection
            'sql = "Update [Sheet1$] set [C3] = 'New Name' where id=1"
            sql = "Update [ICD10 Data$] set [Result] = 'Incomplete' WHERE [Payer Claim Number]=''"

            myCommand.CommandText = sql
            myCommand.ExecuteNonQuery()
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try

Open in new window

0
Comment
Question by:prosit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 39204622
Try
WHERE [Payer Claim Number] Is Null

Open in new window

0
 
LVL 2

Author Closing Comment

by:prosit
ID: 39204668
I had tried "= Null"...

"IS NULL" was the difference...  ugh...

thanks

~j
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Groupbox Control ? 2 39
Need help with a query 3 49
Excel Web Add-in Where is Visual Basic used 9 83
Call a VB.net function in Javascript 6 51
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question