Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if the first IF/End If deletes the file if it exists, and then the second
block of code tries to open the file, so it must fail....hence the error. "Hydra" wrote in message ... This threw a type mismatch error ??? strDB is Dim as string and contains the name of a valid path. "JLGWhiz" wrote: Try it this way: If Not Dir(strDB) Is NothingThen "Hydra" wrote in message ... If Dir(strDB) < "" Then Kill strDB End If Set AppAccess = CreateObject("Access.Application") AppAccess.Visible = True AppAccess.OpenCurrentDatabase strDB AppAccess.DoCmd.Opentable "MSP Data", acViewNormal, acAdd --------------------------------------------- Throws an Error cannot open the database because it is missing or opend exclusively by another user ------------------------------------------- If Dir("C:\DataCheck.mdb") < "" Then MsgBox "Datacheck Exists" Kill "C:\DataCheck.mdb" End If Set appAccess = CreateObject("Access.Application") appAccess.Visible = True With appAccess .NewCurrentDatabase ("C:\DataCheck.mdb") .Visible = True --------------------------------------------- Throws an error saying there is an existing database with this name, choose another name. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Kill a File | Excel Programming | |||
Kill | Excel Programming | |||
'Kill' | Excel Programming | |||
File kill help | Excel Programming | |||
scrollbar control of a chart, live or not live | Excel Programming |