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 / Importing / Linking / September 2004

Tip: Looking for answers? Try searching our database.

Import from Excel Issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sarah - 14 Sep 2004 16:55 GMT
A user of mine is having issues importing from Excel and
I cannot debug.  OfficeXP, Access2000, Excel(8).  

Here is the code, which for the life of me I cannot
figure out what is not working:

Dim myXL As Excel.Application
Dim myWB As Workbook
Dim myWS As Worksheet

Set myXL = GetObject(, "Excel.Application")
****at this poing myXL is valid

strFullName = Me.txtDefaultPath.Value
Set MyWB = myXL.Workbooks.Open(strFullName)
Set myWS = MyWB.Worksheets(1)
****at this point, myWB and myWS are equal to Nothing.  
Can't figure out why.  Any help is appreciated.  Thanks!
John Nurick - 14 Sep 2004 20:59 GMT
Hi Sarah,

This would happen if error handling has been turned off with
    On Error Resume Next
and strFullName is not the filespec of an Excel workbook.

If that's not the problem, try using
 Set myXL = CreateObject("Excel.Application")
If that works, it suggests there's something odd about the running
instance of Excel that's being found by the GetObject() call.

>A user of mine is having issues importing from Excel and
>I cannot debug.  OfficeXP, Access2000, Excel(8).  
[quoted text clipped - 14 lines]
>****at this point, myWB and myWS are equal to Nothing.  
>Can't figure out why.  Any help is appreciated.  Thanks!

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Sarah - 15 Sep 2004 19:18 GMT
Thank you.  In fact, error handling was turned off.  Of
course there was also an issue with the way the "get UNC
path" was retreiving the spreadsheet, which inadvertently
effected this import process.

Thanks for your reply.
>-----Original Message-----
>Hi Sarah,
[quoted text clipped - 32 lines]
>Please respond in the newgroup and not by email.
>.
bbttyy - 24 Sep 2004 03:26 GMT
"Sarah" <Sarah@discussions.microsoft.com>
??????:1f7301c49a73$4ffa8070$a501280a@phx.gbl...
> A user of mine is having issues importing from Excel and
> I cannot debug.  OfficeXP, Access2000, Excel(8).
[quoted text clipped - 14 lines]
> ****at this point, myWB and myWS are equal to Nothing.
> Can't figure out why.  Any help is appreciated.  Thanks!
 
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.