Results 1 to 25 of 25

Thread: [RESOLVED] What is preventig file being writtten?

  1. #1

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Resolved [RESOLVED] What is preventig file being writtten?

    I've got a VB project that cycles through a txt file and extracts data from that txt file into Excel files. The project creates Excel files based on what it finds in the txt file.

    My problem: The code works beautifully on the first two sets of data it finds, but when it encounters a third set of data, although the program reads through the data, it does not create a resultant third Excel file. I've stepped through the code and confirmed that data is being encountered.

    Is there a limit on the number of Excel workbooks that can be created? Here is the code snippet I have at the end of my project, after data is processed:

    xls.activeworkbook.saveas Filename:=strFilename & ".xls", ReadOnlyRecommended:=False, CreateBackup:=False

    xls.activeworkbook.Close

    xls.workbooks.Add
    xls.Visible = True


    Any help is most welcome! This is driving me crazy!!!!

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: What is preventig file being writtten?

    no there is no limit...

    fo fun .. try starting a new excel...

    xls.activeworkbook.Close
    xls.quit
    set xls = New Excel.appication
    xls.workbooks.Add
    xls.Visible = True
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Static,

    Thanks! I was just thinking the same thing and had the code scribbled on a notepad.

    Can I ask...where you got your knowledge of using Excel within a VB environment? I hate to keep bothering folks, and would love to pick up as much as I can on my own.

    Thanks again

  4. #4
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: What is preventig file being writtten?

    well.. I found the best way to figure out how to do things in excel is to record macros.

    the code gereated is basically what u would use in VB (just add the xls object)
    example:

    in excel:
    Range("A1") = "hello"
    in VB
    xls.Range("A1") = "hello"

    but.. seriously.. post questions here.. thats why people are here.. to help.

    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  5. #5

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Hi, Static....

    Our thoughts about closing Excel, reopening, etc., etc., did not do the trick. Same result.... could write first Excel file, could write second Excel file, but third file would not write.

    I got no error messages, and data was being cycled through.....

    Frustrating!

    If you have any other ideas, I'd love to hear them..... thanks!

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,501

    Re: What is preventig file being writtten?

    I'd recommend reading my Excel tutorial (link in my signature), as it explains why some of the things that you are doing are less than ideal (as well as the right way to do them).

  7. #7

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Static,

    If you would be so kind as to reviewing it, I've enclosed a small data sample as an attachment, and also, here is my code that I'm using to convert my selected txt data to Excel:

    VB Code:
    1. Private Sub CmdConvertGEOLOC_Click()
    2.  
    3.     ExportToExcel
    4.  
    5. End Sub
    6. Private Sub ExportToExcel()
    7.     Dim tmp()            As String
    8.     Dim Data()           As String
    9.     Dim ALLData          As String
    10.     Dim strFilename      As String
    11.     Dim sFileName        As String
    12.     Dim sParts()         As String
    13.     Dim sFigure          As String
    14.     Dim sComponent       As String
    15.     Dim sFigureNumber    As String
    16.     Dim iEmptyCounter    As Integer
    17.     Dim FName            As Variant
    18.     Dim x                As Long
    19.     Dim y                As Long
    20.     Dim I                As Long
    21.     Dim xls              As Object
    22.      
    23.     With dlgCommonDialog
    24.         .Filter = "Text (*.txt)|*.txt"
    25.         .DialogTitle = "Select your desired Rockwell Collins file to open"
    26.         .Flags = cdlOFNFileMustExist
    27.         .CancelError = True
    28.         .InitDir = App.Path
    29.         .ShowOpen
    30.         strFilename = Trim$(.Filename)
    31.     End With
    32.    
    33.     sFileName = Trim$(strFilename)
    34.     sParts = Split(sFileName, "\")
    35.     sFileName = sParts(UBound(sParts))
    36.        
    37.     Set xls = CreateObject("Excel.application")
    38.        
    39.     xls.workbooks.Add
    40.     xls.Visible = True
    41.    
    42.     Open sFileName For Input As #1
    43.         ALLData = Input(LOF(1), 1)
    44.     Close #1
    45.    
    46.     Do Until InStr(ALLData, "  ") = 0
    47.         ALLData = Replace(ALLData, "  ", " ")
    48.     Loop
    49.    
    50.     x = 0
    51.  
    52.     tmp = Split(ALLData, vbCrLf)
    53.     Dim Row As Integer
    54.     Row = 2
    55.     For y = x To UBound(tmp)
    56.  
    57.         If Left(tmp(y), 24) = "Component Location Chart" Then Stop
    58.  
    59.         If Left(tmp(y), 6) = "Figure" Then
    60.             sFigure = Left(tmp(y), 6)
    61.             sFigureNumber = Mid(tmp(y), 8, 2)
    62.             If Mid(sFigureNumber, 2, 1) = "." Then
    63.                 sFigureNumber = "0" & Mid(sFigureNumber, 1, 1)
    64.             End If
    65.                
    66.         End If
    67.         If Left(tmp(y), 24) = "Component Location Chart" Then sComponent = Left(tmp(y), 24)
    68.         If sFigure = "Figure" And sComponent = "Component Location Chart" Then Stop
    69.        
    70.         If sFigure = "Figure" And sComponent = "Component Location Chart" Then
    71.            
    72.            strFilename = Mid(sFileName, 1, 11) & "-Fig" & sFigureNumber & "-Final"
    73.            
    74. section1:
    75.             For x = y To UBound(tmp)
    76.                 If Left(tmp(x), 31) = "   COMPONENT MAINTENANCE MANUAL" Then
    77.                     GoTo Section6
    78.                 End If
    79.                
    80.                 If Left(tmp(x), 32) = "* DESIGNATES BACKSIDE COMPONENTS" Then
    81.                     GoTo Section2
    82.                 End If
    83.                
    84.                 If Left(tmp(x), 24) = "Component Location Chart" Then
    85.                     GoTo section1next
    86.                 End If
    87.                
    88.                 If Left(tmp(x), 3) = "REF" Or Left(tmp(x), 3) = "DES" Then
    89.                     GoTo section1next
    90.                 End If
    91.                
    92.                 If tmp(x) Like "*Page*" Or tmp(x) Like "*/*" Or tmp(x) Like "*ROCKWELL COLLINS*" Or _
    93.                 tmp(x) Like "*COMPONENT*" Or tmp(x) Like "*PART*" Or tmp(x) Like "*Figure*" Then
    94.                     GoTo section1next
    95.                 End If
    96.                                
    97.                 If Left(tmp(x), 1) = " " Then
    98.                     GoTo section1next
    99.                 End If
    100.                                
    101.                 If Left(tmp(x), 2) <> "" Then
    102.                     Data = Split(tmp(x), " ")
    103.                     For I = 0 To 2
    104.                         xls.Cells(Row, I + 1) = Data(I)
    105.                     Next
    106.                     Row = Row + 1
    107.                 End If
    108. section1next:
    109.              Next
    110.              
    111. Section2:
    112.  
    113.              For x = y To UBound(tmp)
    114.                 If Left(tmp(x), 31) = "   COMPONENT MAINTENANCE MANUAL" Then
    115.                     GoTo Section6
    116.                 End If
    117.                
    118.                 If Left(tmp(x), 32) = "* DESIGNATES BACKSIDE COMPONENTS" Then
    119.                     GoTo Section3
    120.                 End If
    121.                
    122.                 If Left(tmp(x), 24) = "Component Location Chart" Then
    123.                     GoTo Section2Next
    124.                 End If
    125.                
    126.                 If Left(tmp(x), 3) = "REF" Or Left(tmp(x), 3) = "DES" Then
    127.                     GoTo Section2Next
    128.                 End If
    129.                
    130.                 If tmp(x) Like "*Page*" Or tmp(x) Like "*/*" Or tmp(x) Like "*ROCKWELL COLLINS*" Or _
    131.                 tmp(x) Like "*COMPONENT*" Or tmp(x) Like "*PART*" Or tmp(x) Like "*Figure*" Then
    132.                     GoTo Section2Next
    133.                 End If
    134.                
    135.                 If tmp(x) Like "*Figure*" Then
    136.                     GoTo Section2Next
    137.                 End If
    138.                
    139.                 If Left(tmp(x), 1) = " " Then
    140.                     GoTo Section2Next
    141.                 End If
    142.                
    143.                 If Left(tmp(x), 2) <> "" Then
    144.                     Data = Split(tmp(x), " ")
    145.                     For I = 3 To 5
    146.                         xls.Cells(Row, I - 2) = Data(I)
    147.                     Next
    148.                     Row = Row + 1
    149.                    
    150.                 End If
    151. Section2Next:
    152.             Next
    153.            
    154. Section3:
    155.  
    156.             For x = y To UBound(tmp)
    157.                 If Left(tmp(x), 31) = "   COMPONENT MAINTENANCE MANUAL" Then
    158.                     GoTo Section6
    159.                 End If
    160.                
    161.                 If Left(tmp(x), 32) = "* DESIGNATES BACKSIDE COMPONENTS" Then
    162.                     GoTo Section4
    163.                 End If
    164.                
    165.                 If Left(tmp(x), 24) = "Component Location Chart" Then
    166.                     GoTo Section3Next
    167.                 End If
    168.                
    169.                 If Left(tmp(x), 3) = "REF" Or Left(tmp(x), 3) = "DES" Then
    170.                     GoTo Section3Next
    171.                 End If
    172.                
    173.                 If tmp(x) Like "*Page*" Or tmp(x) Like "*/*" Or tmp(x) Like "*ROCKWELL COLLINS*" Or _
    174.                 tmp(x) Like "*COMPONENT*" Or tmp(x) Like "*PART*" Or tmp(x) Like "*Figure*" Then
    175.                     GoTo Section3Next
    176.                 End If
    177.                
    178.                 If Left(tmp(x), 1) = " " Then
    179.                     GoTo Section3Next
    180.                 End If
    181.                
    182.                 If Left(tmp(x), 2) <> "" Then
    183.                     Data = Split(tmp(x), " ")
    184.                     For I = 6 To 8
    185.                         xls.Cells(Row, I - 5) = Data(I)
    186.                     Next
    187.                     Row = Row + 1
    188.                    
    189.                 End If
    190.                
    191. Section3Next:
    192.  
    193.             Next
    194.            
    195. Section4:
    196.  
    197.             For x = y To UBound(tmp)
    198.                 If Left(tmp(x), 31) = "   COMPONENT MAINTENANCE MANUAL" Then
    199.                     GoTo Section6
    200.                 End If
    201.                
    202.                 If Left(tmp(x), 32) = "* DESIGNATES BACKSIDE COMPONENTS" Then
    203.                     GoTo Section6
    204.                 End If
    205.                
    206.                 If Left(tmp(x), 24) = "Component Location Chart" Then
    207.                     GoTo Section4next
    208.                 End If
    209.                
    210.                 If Left(tmp(x), 3) = "REF" Or Left(tmp(x), 3) = "DES" Then
    211.                     GoTo Section4next
    212.                 End If
    213.                
    214.                 If tmp(x) Like "*Page*" Or tmp(x) Like "*/*" Or tmp(x) Like "*ROCKWELL COLLINS*" Or _
    215.                 tmp(x) Like "*COMPONENT*" Or tmp(x) Like "*PART*" Or tmp(x) Like "*Figure*" Then
    216.                     GoTo Section4next
    217.                 End If
    218.                
    219.                 If Left(tmp(x), 1) = " " Then
    220.                     GoTo Section4next
    221.                 End If
    222.                
    223.                 If Left(tmp(x), 2) <> "" Then
    224.                     Data = Split(tmp(x), " ")
    225.                     For I = 9 To 11
    226.                         If Data(I) Like "*TP*" Or Data(I) = "" Or IsNull(Data(I)) Then
    227.                             GoTo Section6
    228.                         End If
    229.                         xls.Cells(Row, I - 8) = Data(I)
    230.                     Next
    231.                     Row = Row + 1
    232.                 End If
    233.  
    234. Section4next:
    235.  
    236.             Next
    237.  
    238. Section5:
    239.  
    240. Stop
    241.  
    242. y = x + 1
    243. GoTo section1
    244.  
    245. Section6:
    246.            
    247.             xls.activeworkbook.saveas Filename:=strFilename & ".xls", ReadOnlyRecommended:=False, CreateBackup:=False
    248.            
    249.             sFigure = ""
    250.             sComponent = ""
    251.             strFilename = ""
    252.             sFigureNumber = ""
    253.  
    254.             xls.activeworkbook.Close
    255.            
    256.             xls.quit
    257.            
    258.             Set xls = CreateObject("Excel.application")
    259.                      
    260.             xls.workbooks.Add
    261.             xls.Visible = True
    262.            
    263.             y = x
    264.         End If
    265.  
    266.     Next
    267.  
    268. End Sub

    I just can't figure what is happening on the third piece of data.

    Si,

    I'll take a look at your Tutorial..... is there a place in your tutorial regarding repeating data??

    Thank you all...... this forum is so much better than trying to get results from Microsoft's site!
    Attached Files Attached Files
    Last edited by MartinLiss; Apr 24th, 2006 at 10:22 AM.

  8. #8
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: What is preventig file being writtten?

    You can use the Object Browser in Excel to view objects and then look them up in Excels help file to get more information.
    VB/Office Guru™ (AKA: Gangsta Yoda™ )
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    • Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Re: What is preventig file being writtten?

    Quote Originally Posted by greaseman
    I've got a VB project that cycles through a txt file and extracts data from that txt file into Excel files. The project creates Excel files based on what it finds in the txt file.

    My problem: The code works beautifully on the first two sets of data it finds, but when it encounters a third set of data, although the program reads through the data, it does not create a resultant third Excel file. I've stepped through the code and confirmed that data is being encountered.

    Is there a limit on the number of Excel workbooks that can be created? Here is the code snippet I have at the end of my project, after data is processed:

    xls.activeworkbook.saveas Filename:=strFilename & ".xls", ReadOnlyRecommended:=False, CreateBackup:=False

    xls.activeworkbook.Close

    xls.workbooks.Add
    xls.Visible = True


    Any help is most welcome! This is driving me crazy!!!!
    Could the data in the 3rd file be the problem? If that's a possibility the then somehow skip over the file and see what happens.

  10. #10

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    RobDog and Martin, thanks for your replies.....

    RobDog, I don't think it's a question about Excel objects, since my code worked successfully through the first two data portions and produced Excel files nicely. And, tracing through my code on the third data portion indicated that data was being "grabbed" from the text file, just not being written to the Excel file..... that's what's got me stumped.

    Martin, I already tried switching to a completely different input txt data file and got the same results, but thanks for your suggestion.

    Maybe if I took stronger medication.......

  11. #11
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Re: What is preventig file being writtten?

    Why do you have the following?

    VB Code:
    1. If sFigure = "Figure" And sComponent = "Component Location Chart" Then Stop
    2.        
    3.         If sFigure = "Figure" And sComponent = "Component Location Chart" Then
    I don't think I've ever seen anyone actually use Stop before but in any case as I understand it it acts like End in an exe and as a breakpoint in the IDE, so what are you trying to accomplish?

  12. #12

  13. #13

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Martin,

    I have the "stop" in my code so that the code would "stop" at a certain point, and I could then see what was in my "tmp" variable. This was the only way I knew of to stop my code at different places to see what data was beig handled. Is there a different way of accomplishing this?

    Also, concerning the "goto" code, I didn't know of any better way of having my code go from one part of my program to another.

    Any suggestions are most welcome, since I'm always in favor of code that works better.

    Thanks for your replies!

  14. #14
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Re: What is preventig file being writtten?

    Quote Originally Posted by greaseman
    Martin,

    I have the "stop" in my code so that the code would "stop" at a certain point, and I could then see what was in my "tmp" variable. This was the only way I knew of to stop my code at different places to see what data was beig handled. Is there a different way of accomplishing this?

    Also, concerning the "goto" code, I didn't know of any better way of having my code go from one part of my program to another.

    Any suggestions are most welcome, since I'm always in favor of code that works better.

    Thanks for your replies!
    Click in the left margin of any line(s) you want the code to stop at while excecuting in the IDE. You can also add Watches and if you don't know how to do that then search for posts by me with "watch" in the text and you'll get an explanation. I'll post a GoTo-less modification of some of your code in a few minutes.

  15. #15
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Re: What is preventig file being writtten?

    Here is a start

    VB Code:
    1. For x = y To UBound(tmp)
    2.                 If Left(tmp(x), 31) = "   COMPONENT MAINTENANCE MANUAL" Then
    3.                     Section6 ' Change the code in section6 to a Sub or Function
    4.                     Exit For
    5.                 End If
    6.                
    7.                 If Left(tmp(x), 32) = "* DESIGNATES BACKSIDE COMPONENTS" Then
    8.                     GoTo Section2 ' Change the code in section2 to a Sub or Function
    9.                     Exit For
    10.                 End If
    11.                
    12.                 ' The following 4 If statements could probably be combined into one big If
    13.                 ' but it might be better for clarity to leave it as it is
    14.                 If Left(tmp(x), 24) = "Component Location Chart" _
    15.                     Or Left(tmp(x), 3) = "REF" _
    16.                     Or Left(tmp(x), 3) = "DES" Then
    17.                         Exit For
    18.                 End If
    19.                
    20.                 If tmp(x) Like "*Page*" Or tmp(x) Like "*/*" Or tmp(x) Like "*ROCKWELL COLLINS*" Or _
    21.                 tmp(x) Like "*COMPONENT*" Or tmp(x) Like "*PART*" Or tmp(x) Like "*Figure*" Then
    22.                     Exit For
    23.                 End If
    24.                                
    25.                 If Left(tmp(x), 1) = " " Then
    26.                     Exit For
    27.                 End If
    28.                                
    29.                 If Left(tmp(x), 2) <> "" Then
    30.                     Data = Split(tmp(x), " ")
    31.                     For I = 0 To 2
    32.                         xls.Cells(Row, I + 1) = Data(I)
    33.                     Next
    34.                     Row = Row + 1
    35.                 End If
    36.              Next

  16. #16

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Martin,

    Thanks for your comments and suggestios! I'll try the goto - less idea and will also try the tracing methods you suggested.

    I'd still love to know what prevents that pesky third Excel file from getting any data written to it..... the Excel file opens OK, but nothing is written there.
    I am definitely frustrated and of course am under the proverbial deadline.

    Thanks for your help!

  17. #17

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Martin, Rob and Static,

    Could my problem be somehow related to my code not pointing to the correct Workbook?

    In my code, toward the end, I have the lines

    xls.workbooks.Add
    xls.Visible = True

    How might I point my code in these lines to the correct workbook?

    If Left(tmp(x), 2) <> "" Then
    Data = Split(tmp(x), " ")
    For I = 0 To 2
    xls.Cells(Row, I + 1) = Data(I) '<==== how do I refer to a workbook here?
    Next
    Row = Row + 1
    End If

    Thanks once more!!!!

  18. #18
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: What is preventig file being writtten?

    no.. when Adding a workibook.. unless u specifically point to another workbook.. then
    Sheet1 of then new workbook will be the active sheet...

    Now.. if the first 2 work fine, then I have to agree that it must be something with the data...

    (I also agree with limiting Goto's except for On Error Goto....)
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  19. #19

  20. #20
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,501

    Re: What is preventig file being writtten?

    I would recommend always specifying the sheet as in Martins example, as the ActiveSheet (or ActiveAnything) can be changed at any time - and not necessarily just by code (if the user is working in Excel too, they will constantly be changing it).

    If you look at post #5 of my tutorial you will see various ways to declare and close the WorkSheet object (as well as the WorkBook - which you should also be using a variable for).

  21. #21
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: What is preventig file being writtten?

    Yes, you should not use a blind workbook object like .ActiveWorkbook when adding another book.

    xls.workbooks.Add

    Should be like...

    Dim oWB As Excel.Workbook
    Set oWB = xls.workbooks.Add

    This will give you a reference to that exact newly created workbook and will not change as long as you reference the oWB object variable.


    Stop is good for use when debugging your code but dont forget to take it out when your done.
    VB/Office Guru™ (AKA: Gangsta Yoda™ )
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    • Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  22. #22

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    To all..............

    THANK YOU!!!!! I truly appreciate the advice and comments and will be applying them to my project as soon as possible. This forum is wonderful, and I've received more information that is more understandable than I could have hoped for on Microsoft.

    Again, thank you all...... will keep you advised of the progress my project has made within the next day to two days.

  23. #23

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Static, Rob, Martin and Si....

    Guess what???? My program was writing out my files all the time! What happened was that as I wrote file 1, my row counter was getting incremented (which was what I wanted), and then when it wrote File 2, I could still see records on my screen, but, because of the row counter being incremented, when I got to file 3, my screen was not showing any records because they were below the bottom of the screen.

    Boy, do I feel like a dummy!

    Here's my next question -- if I have a group of data that spills from one page to another page to another page and so on, how might I keep all of the data in one file while records are being processed?

    Thanks so much for your earlier assistance....... I appreciate your suggestions!!

  24. #24

  25. #25

    Thread Starter
    Hyperactive Member greaseman's Avatar
    Join Date
    Jul 2005
    Location
    Somewhere, out there...
    Posts
    295

    Re: What is preventig file being writtten?

    Martin,

    Not a problem.... I'll start a new thread. Thanks for your earlier replies and help!

Posting Permissions

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



Click Here to Expand Forum to Full Width