Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Office Automation > Error opening excel in a dll


Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2012, 02:21 AM
michelleqw michelleqw is offline
Junior Contributor
 
Join Date: Jun 2005
Posts: 212
Default Error opening excel in a dll


Dear all,

We have created a dll to convert an excel spreadsheet to a csv file. At the moment we open the xls file, an eror occured (file doesn't exist / is used by an other user)

Maybe knows someone a solution.

Used code:
Dim excel As New Microsoft.Office.Interop.Excel.Application
Dim wb = excel.Workbooks.Open("d:\my.xls") '<<<<<<<<<<< not possible to open
wb.SaveAs("d:\my.csv", Microsoft.Office.Interop.Excel.XlFileFormat.xlTextMSDOS)
wb.Close(SaveChanges:=False)

Nice regards,
Michelle
Reply With Quote
  #2  
Old 04-30-2012, 07:46 AM
Cerian Knight's Avatar
Cerian Knight Cerian Knight is online now
Multi-Technologist

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 3,883
Default

I don't have much use for .NET, but since no on else has responded... I've tried this code non-DLL (~5 minute using VS2010 Express is all I can tolerate ) and it works fine. Have you done so, as well?

I just want to be sure that this issue is only related to the DLL or how it is called (not e.g. a D:\ root permissions/FAT32 issue). That being the case, show us how it is called (and make sure it is called only once). Otherwise, make the files/file references in a folder and see if same result.

Also, couldn't help but notice the 'xlTextMSDOS'... which seems odd. Is that intentional (as opposed to 'xlCSV' or 'xlCSVMSDOS')?
__________________
Are your apps high DPI ready?
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
 
 
-->