+ Reply to Thread
Results 1 to 9 of 9

VBA Find Code not working with XML file like it did in XLS file - Please Help

  1. #1
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Lightbulb VBA Find Code not working with XML file like it did in XLS file - Please Help

    All,

    I had code working in an XLS file, but it does not work in XML files. I had a find working in the XLS file and it looked like this

    Please Login or Register  to view this content.
    Setting the variable beginRow to Str(ge.Row) is giving me no value. It used to find the variable and put the column and row to start in. The find still finds the variable gMycell, but it does not convert it to a cell location when it gets down to the beginRow = Str(ge.Row)

    Does anyone know a fix for this? I don't know why it does not work when it used to except for changing file types. This is all I can think of.

    Thank you -- SEOT

  2. #2
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    Anyone have an idea on this one? I am going to run it by a friend tomorrow. I will let you know what they tell me. They might can get it. --SEOT

  3. #3
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    I found out more now. The XML file is not really an Excel file, so I am trying something else now. I am taking the .xml file that downloaded out of our accounting system and saving it as a .xls file like I used to use. Now, I try to use the code I used to have working with the .xls file, and I am getting the following error 'object variable or with block variable not set'

    My code now is the following:
    Please Login or Register  to view this content.
    The error I get is on line 'beginRow = ge.Row'

    Thanks for any help you can give. - SEOT

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    It would be helpful if you showed the entire code. In the code you show, beginrow is not defined. This could be problematic if you have your code set as Option Explicit which is a good practice.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    I have alot of global variables declared in another module in the Excel VBA code. Here is a long list of them
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    Anyone have a clue on this. I am still at a loss. -SEOT

  7. #7
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    Please Login or Register  to view this content.
    beginRow = ge.Row
    This line of code gives me a run-time error '91' - Object Variable or With Block Variable Not Set
    I cannot figure out how to get past this error

    Please Login or Register  to view this content.
    My gbeginRow is declared in under the code above in a different Module, so it is declared in my program.

  8. #8
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help

    Still Stuck.... Anyone know???- SEOT

  9. #9
    Forum Contributor
    Join Date
    05-20-2008
    Location
    Virginia
    MS-Off Ver
    2003
    Posts
    129

    Re: VBA Find Code not working with XML file like it did in XLS file - Please Help (SOLVED)

    I found a work around, and I have most of my code working again. I got another point stuck, but I will post that in a different area as a different post. The work around is saving the XML down to an Excel 97-2003 Worksheet after downloading it off the system. I have it saving it in the old format in the code before working on the sheets. Then, I don't have to deal with XML. -- SEOT

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problems working with a shared file contaning VBA Code.-question for the advanced
    By yossiperets in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2013, 04:49 AM
  2. Replies: 1
    Last Post: 02-09-2013, 02:15 AM
  3. Replies: 0
    Last Post: 01-27-2013, 12:13 PM
  4. [SOLVED] VBA Code to Enter File Name, Activate the File, and Run Macro on File
    By DHartwig35805 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-09-2012, 03:49 PM
  5. [SOLVED] File Size Code not working
    By briank in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-02-2005, 01:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1