Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

excel file is locked

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SIN - 27 May 2007 20:16 GMT
Hi ,
After importing an excel file, using the following code,
the excel file is locked and can open it Read Only.

Set xlApp = CreateObject("Excel.Application")
xlApp.DisplayAlerts = False
Set xlWkb = xlApp.Workbooks.Open("C:\ImportData\" & v_flie_name & ".xls")
Set xlSht = xlWkb.Sheets(1)
Set xlRng = xlSht.Cells(v_row, v_column)
xlWkb.Close

Do you have any ideas why is this happened?
thanks.
Dirk Goldgar - 27 May 2007 20:25 GMT
> Hi ,
> After importing an excel file, using the following code,
[quoted text clipped - 9 lines]
> Do you have any ideas why is this happened?
> thanks.

I'm not sure, but try releasing all the objects you created:

   xlWkb.Close

   Set xlRng = Nothing
   Set xlSht = Nothing
   Set xlWkb = Nothing
   Set xlApp = Nothing

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Norman Yuan - 27 May 2007 23:53 GMT
> I'm not sure, but try releasing all the objects you created:
>
>    xlWkb.Close

'also add following code
   xlApp.Quit

>    Set xlRng = Nothing
>    Set xlSht = Nothing
>    Set xlWkb = Nothing
>    Set xlApp = Nothing
SIN - 31 May 2007 19:44 GMT
Thanks, i added AND the file is stile in status: read only

> > Hi ,
> > After importing an excel file, using the following code,
[quoted text clipped - 18 lines]
>     Set xlWkb = Nothing
>     Set xlApp = Nothing
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.