Results 1 to 2 of 2
  1. #1
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480

    txt file to hold code, that can be executed by vba? Txt file as dll kind of?

    Hello,



    I have created some class modules that basically store coordinates for different fields on a main frame emulator system. I'm wondering if its possible to store these class modules as txt or ini files and store them in a central location instead of putting them inside each terminal... If something changes on one of the screens, I would only have to change the coordinates in the text file instead of opening up dozens of separate systems to make the same change.





    Class Module (txt/ini) Code Example:
    Code:
    Variable1 = GetDisplayText(16, 15, 1)  'This represents the coordinates I'd like the code to use to look for variable1. 
    Variable2 = GetDisplayText(16, 30, 1)
    Variable3 = GetDisplayText(16, 57, 3)
    Variable4 = GetDisplayText(16, 72, 8)
    etc, etc, etc


    SO using textstream , I'm able to load the coordinates into the vba as a string, but I'm having a hell of a time figuring out how to run that in the vba itself. Normally when the vba runs

    Variable2 = GetDisplayText(16, 30, 1)

    Variable2 will become what ever is located at those coordinates, so far I'm only to get Variable2 to equal Variable2 = GetDisplayText(16, 30, 1)...



    Any ideas? Tips?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    have a module that opens the txt file.
    Code:
    LoadTxtFile()
    const kFILE as "c:\settings\coordinates.txt"
    dim vLine
    
    open kfile for input as #1
    while not eof(1)
       line input #1, vLine
       'store data in table?
    wend
    close 1
    end sub
    then you only need to update the coordinates.txt file

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

Similar Threads

  1. Replies: 14
    Last Post: 05-24-2017, 02:22 PM
  2. Replies: 2
    Last Post: 04-01-2016, 10:38 AM
  3. Replies: 13
    Last Post: 12-12-2013, 07:22 PM
  4. Replies: 10
    Last Post: 03-04-2012, 12:17 AM
  5. VBA code for export to pdf file
    By Milan25 in forum Programming
    Replies: 4
    Last Post: 02-01-2011, 12:37 PM

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