?
Solved

Phantom person using excel file

Posted on 2003-03-04
3
Medium Priority
?
161 Views
Last Modified: 2010-04-07
I have been programming a little VB referencing the excel library. I open the file using the workbooks.open command. Then i close it with workbooks.close command. however, after running this code, whenever i try to open the "1.csv" file now, it says that it is locked for editing, by 'another user'. what's going on?


sub main()

Workbooks.Open FileName:="C:\Documents and Settings\Jason\My Documents\1.csv"

a = Range("b8")
MsgBox (a)
Workbooks.Close
end sub
0
Comment
Question by:storkuk79
[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
3 Comments
 

Expert Comment

by:cskang
ID: 8063536
One reason is that your application crashed or you ended it in debug mode before executing the Workbooks.close  .
If that is the problem
goto
Windows Task Manager >> processes tab
find excel.exe
end process
0
 

Accepted Solution

by:
gprassad earned 600 total points
ID: 8063598
hi storkuk79

try this one...


Option Explicit
Dim xlsApp As Excel.Application

Private Sub Command1_Click()
    Set xlsApp = Excel.Application
   
    xlsApp.Visible = True
    xlsApp.workbooks.Open ("C:\1.csv")
   
    MsgBox xlsApp.Range("B8")
    xlsApp.workbooks.Close
    xlsApp.Quit

       
   
End Sub
0
 

Author Comment

by:storkuk79
ID: 8069000
thanks for help guys
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month12 days, 8 hours left to enroll

777 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