Results 1 to 6 of 6
  1. #1
    Keemo is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Location
    Manson's Landing BC
    Posts
    3

    CurrentProject.ImportExportSpecifications.XML gives method or data member not found

    I am working on a semi-automated spread sheet import, it did work, mow all of a sudden it fails, with
    debugstr = CurrentProject.ImportExportSpecifications.XML claiming the .xml is not found

    sample snippit
    [code]
    ' Pass it to the saved import
    Dim OldSpec As ImportExportSpecification
    Dim ImportSpec As ImportExportSpecification
    Dim x As Integer
    Dim debugstr As String
    'Set OldSpec = CurrentProject.ImportExportSpecifications.Item(0)
    For x = 0 To CurrentProject.ImportExportSpecifications.Count - 1 'radioboss import to come
    If CurrentProject.ImportExportSpecifications.Item(x) = "Import-Log Sheet" Then
    Set ImportSpec = CurrentProject.ImportExportSpecifications.Item(x)
    debugstr = CurrentProject.ImportExportSpecifications.XML 'fails here


    End If
    Next x

    debugstr = CurrentProject.ImportExportSpecifications.XML 'fails here
    Set OldSpec = CurrentProject.ImportExportSpecifications.Item("Im port-Log Sheet")
    'CurrentProject.ImportExportSpecifications.Add "Import-Log Sheet", OldSpec.XML


    'Set ImportSpec = CurrentProject.ImportExportSpecifications.Item("Im port-Log Sheet")
    ImportSpec.XML = Replace(OldSpec.ImportExportSpecifications.XML, "C:\Users\Owner\Downloads\Eclectic 20-11-21Log Sheet.xlsx", FilePath) 'also fails here.


    ImportSpec.Execute
    [/code

    This did work, I have rewritten the saved import, still no joy on the .xml member.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,924
    CurrentProject.ImportExportSpecifications is a collection object. You can refer to Add, Application, Count, Item, or Parent. Unless you managed to add a property somehow, xml would not be one of them. I think you need the object refererence (drop the "s")

    CurrentProject.ImportExportSpecification.XML

    When posting code, please used code tags (see # on posting toolbar) with proper indentation.
    Thanks, and hope that helps.
    Grief o'er the loss of one loved is not a destination, but a journey.
    Oft content upon arrival are we, only to find there are miles yet to travel.

    Micron

  3. #3
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,130
    Colin (Mendip Data Systems): Website, email
    Try again. Fail again. Fail better.
    A
    sking for help isn't giving up. Its refusing to give up.

  4. #4
    Keemo is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Location
    Manson's Landing BC
    Posts
    3
    I have eliminated every possible way of having made a mistake. After a fresh build of the master xcell sheet for the saved import, I rewrote all the CurrentProject. stuff using the dropdowns, and everything to the right of the '.' was selected from the filtered as appropriate list, right down to CurrentProject.ImpoertExportSpecifications.Item(x) .XML. and yet
    <full code>.Item(x) rewards me with:
    Run-time error '438': Object doesn't support this property or method

    Could be possible I am missing an addon or something for runtime?

    The function did work, this is new behavior.

  5. #5
    Keemo is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2021
    Location
    Manson's Landing BC
    Posts
    3
    the
    's' is required, all the CurrentProject members as well as the ImportExportSpecifications objects can be selected from the dropdowns rigth to Item(x).XML
    See my new post below.

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    9,924
    If you write CurrentProject.ImportExportSpecification you will get one list. If you write CurrentProject.ImportExportSpecifications, you get a different list. XML is in the "s"-less list on my pc.
    I have eliminated every possible way of having made a mistake
    Yet you are raising an error, so clearly you have not.
    I don't think I have any more to offer because this isn't an area I've written a lot of code for.
    Grief o'er the loss of one loved is not a destination, but a journey.
    Oft content upon arrival are we, only to find there are miles yet to travel.

    Micron

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Method or data member not found
    By annmv888 in forum Access
    Replies: 1
    Last Post: 12-17-2016, 08:36 PM
  2. Me.DOExp - Method or data member not found
    By GraeagleBill in forum Forms
    Replies: 4
    Last Post: 02-12-2016, 07:16 PM
  3. Method or data member not found
    By hendrikbez in forum Access
    Replies: 2
    Last Post: 11-21-2014, 10:52 AM
  4. Method or Data Member not found
    By johnnyBQue in forum Programming
    Replies: 4
    Last Post: 11-03-2014, 07:15 AM
  5. Method or data member not found
    By papa yaw in forum Programming
    Replies: 5
    Last Post: 12-17-2012, 02:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums