RonaldBiemans
asked on
reading open Excel file
Is there anyway to read an OPEN excel file into a datatable (readonly is ok)
ASKER
Tgannetts, I know how to open a closed excel file the problem reading an OPEN excel file.
The problem is the excel file I need to read is opened by an external program and is constantly updated by that program.
The problem is the excel file I need to read is opened by an external program and is constantly updated by that program.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Tgannetts, I though about that solution myself , but it is too slow.
I found another solution though, I just made a macro in the excel file that saves itself to another file every 10 minutes.
Thanks for your time though, I will award you the points.
I found another solution though, I just made a macro in the excel file that saves itself to another file every 10 minutes.
Thanks for your time though, I will award you the points.
You can view my code also. If it can help you.
https://www.experts-exchange.com/questions/21080437/How-to-get-cell-color-in-excel-using-vb-net.html
https://www.experts-exchange.com/questions/21080437/How-to-get-cell-color-in-excel-using-vb-net.html
This is a bit off topic, but related to this code.
I put the code in exactly as listed in the first note (changed for my file names). When I run the code, I get an "Unhandled Exception" error when running the Fill command. And it does not appear that I have valid access to the excel data, from looking at the watchlog. I'm new to VB net, and do not know how to determine what is not working right.
These are the error logs:
'DefaultDomain': Loaded 'e:\windows\microsoft.net\ framework\ v1.1.4322\ mscorlib.d ll', No symbols loaded.
'My Excel Automation': Loaded 'E:\Documents and Settings\D865\My Documents\Visual Studio Projects\My Excel Automation\bin\My Excel Automation.exe', Symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s ystem.wind ows.forms\ 1.0.5000.0 __b77a5c56 1934e089\s ystem.wind ows.forms. dll', No symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s ystem\1.0. 5000.0__b7 7a5c561934 e089\syste m.dll', No symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s ystem.draw ing\1.0.50 00.0__b03f 5f7f11d50a 3a\system. drawing.dl l', No symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\m icrosoft.v isualbasic \7.0.5000. 0__b03f5f7 f11d50a3a\ microsoft. visualbasi c.dll', No symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s ystem.data \1.0.5000. 0__b77a5c5 61934e089\ system.dat a.dll', No symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s ystem.xml\ 1.0.5000.0 __b77a5c56 1934e089\s ystem.xml. dll', No symbols loaded.
An unhandled exception of type 'System.Data.OleDb.OleDbEx ception' occurred in system.data.dll
I expect that I have not defined something, but am at a ooss where to look.
Any suggestion where to look or read would be appreciated.
ALex
I put the code in exactly as listed in the first note (changed for my file names). When I run the code, I get an "Unhandled Exception" error when running the Fill command. And it does not appear that I have valid access to the excel data, from looking at the watchlog. I'm new to VB net, and do not know how to determine what is not working right.
These are the error logs:
'DefaultDomain': Loaded 'e:\windows\microsoft.net\
'My Excel Automation': Loaded 'E:\Documents and Settings\D865\My Documents\Visual Studio Projects\My Excel Automation\bin\My Excel Automation.exe', Symbols loaded.
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\m
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s
'My Excel Automation.exe': Loaded 'e:\windows\assembly\gac\s
An unhandled exception of type 'System.Data.OleDb.OleDbEx
I expect that I have not defined something, but am at a ooss where to look.
Any suggestion where to look or read would be appreciated.
ALex
Dim cnn As New OleDb.OleDbConnection("Pro
Dim da As New OleDb.OleDbDataAdapter("Se
Dim ds As New DataSet("TestExcel")
da.Fill(ds)
Tom