LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Imports


I am creating a macro to transfer information from Excel
to Access. Every other time I run it I get an error
stating that "You cannot carry out the action at the
present time". I have a feeling that Access is not closing
properly after I run it the first time. Why am I getting
this error? How do I fix this? Also -- how can I get the
Access window to close -- the database closes just not the
window? Below is my code. Thank You

Dim dba As Access.Application
Dim stgPath As String
Set dba = CreateObject("access.application")
stgPath = ("C:\fink\sta.mdb")
dba.OpenCurrentDatabase filepath:=stgPath
DoCmd.SetWarnings False
DoCmd.OpenQuery "Delete UnlCdL", , acEdit
DoCmd.TransferSpreadsheet acImport, , _
"CD LSTN", ThisWorkbook.FullName, True, "Pcday"
DoCmd.SetWarnings True
dba.CloseCurrentDatabase
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
truncation with imports via html jvblue Excel Worksheet Functions 0 September 23rd 08 10:03 PM
Excel Access Imports Tom J Excel Discussion (Misc queries) 4 May 9th 08 07:26 PM
Data Imports incorrectly Mike H Excel Discussion (Misc queries) 1 August 1st 07 11:42 AM
Regular imports to excel [email protected] Excel Discussion (Misc queries) 3 April 15th 06 02:24 PM
Updating Excel imports John Hipskind Excel Programming 1 August 2nd 03 03:21 PM


All times are GMT +1. The time now is 02:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"