Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Go Back  Xtreme Visual Basic Talk > > > Accesing an Excel file from a windows service written in VB.NET


Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2007, 12:59 PM
carolina carolina is offline
Newcomer
 
Join Date: May 2007
Posts: 1
Unhappy Accesing an Excel file from a windows service written in VB.NET


Hi everybody.

I am getting too many wrinkles due to this problem. I wrote a windows form application that imports an excel file to a dataset and worked on it. It was great. But it needed to be a windows service actually, so I made it. And to my surprise, I just can't get it to work IF the excel file is already opened (as will ALWAYS be the case, because that excel is the bridge between a closed application data, and my service, which will in turn update my DB).

It goes on saying "The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data."

How can that be solved, for God's sake???
Reply With Quote
  #2  
Old 05-18-2007, 02:54 PM
Mike Rosenblum's Avatar
Mike Rosenblum Mike Rosenblum is offline
Microsoft Excel MVP

Forum Leader
* Guru *
 
Join Date: Jul 2003
Location: New York, NY, USA
Posts: 7,848
Default

Hi Carolina,

Welcome to the forum.

I'm not quite sure what you mean here. Why must it be the case that the the Excel workbook is already opened? What if Excel is not currently open (not currently being used by anyone), do you then still have a problem?

If the file is in use (or even potentially in-use), why not copy the file to a temp-folder location and then utilize ADO on that? If your database commands are also updating data on the workbook, then you have concurrency problems and then, yes, you'll have to work out a scheme for access. But if you are only reading in data, then copying the file to a new location should be fine...

Or am I not understanding something here?

Mike
__________________
My Articles:
| Excel from .NET | Excel RibbonX using VBA | Excel from VB6 | CVErr in .NET | MVP |
Avatar by Lebb
Reply With Quote
  #3  
Old 05-20-2007, 04:46 AM
DennisW's Avatar
DennisW DennisW is offline
Junior Contributor
 
Join Date: Mar 2006
Location: Östersund, Sweden
Posts: 268
Default

Hi,

Perhaps a stupid question but are the security permissions for Your account set to full control for both the folder and the 'database' file?
__________________
Kind regards,
Dennis

.NET & Excel | 2nd edition PED | MVP
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
 
Accesing an Excel file from a windows service written in VB.NET
Accesing an Excel file from a windows service written in VB.NET
 
-->