I am in need of programming in VB on a simple project.
Few files r enclosed along the mail
I tried to make the program but am not able to proceed ahead
Please check me file.
What u need to do
Create a folder c:\sunil
Copy the test.txt file there
Use the frm to make exe, select the file test click at the bottom on check box
Press convert, the result file will also go to c”\sunil.
Here the test .txt file has only 4 cloumns and I just needed to add 0.5 to the last value--------------easy
What I need
I need to use the same type by reading a file as “000_1642.RAW”
Program should Read the whole file
Wherever it finds EC1 then in that line in the last figure it should add 0.5 (text2.text)
Rest of the file should remain same
Like below
FTP NEW 2
VER 6.2.2.8
INF "" "" "" "" 0.000 0.000 0.000
FIL "" "C:\HYPACK\Projects\JAIGAD\DREDGING CHANNEL.lnw"
ELL WGS-84 6378137.000 298.257223563
PRO TME xxxxx 75.000000 0.999600 0.000000 0.000000 0.000000 500000.0000 0.0000
DTM 0.00 0.00 0.00 0.00000 0.00000 0.00000 0.00000
GEO ??? 0.000
HVU 1.0000000000 1.0000000000
TND 16:42:00 11/10/2011 -330
DEV 0 32868 "Nmea 0183" 49156 C:\HYPACK\devices\nmea.dll 6.2.7.25l
OFF 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000
DEV 1 16 "Echotrack GLDD" 512 C:\HYPACK\devices\echotrackgldd.dll 6.2.1.3
OFF 1 0.000 0.000 0.000 0.000 0.000 0.000 0.000
EOH
EC1 1 60118.328 5.280------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60118.497 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60118.666 5.310------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60118.835 5.310------------------------------ this value should be added by 0.5 or whatever given in text2.text
POS 0 60118.811 310607.431 1915392.695
QUA 0 60118.811 4 9.100 0.900 9.000 2.000
RAW 0 60118.811 4 171896.15000 731307.65000 -74.40000 111206.00000
EC1 1 60119.005 5.340
GYR 0 60118.974 91.000
EC1 1 60119.174 5.340------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60119.344 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60119.513 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60119.682 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60119.851 5.370------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60120.021 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
POS 0 60119.867 310606.888 1915391.409
QUA 0 60119.867 4 9.100 0.900 9.000 2.000
RAW 0 60119.867 4 171896.08000 731307.62000 -74.40000 111207.00000
EC1 1 60120.190 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
EC1 1 60120.359 5.400------------------------------ this value should be added by 0.5 or whatever given in text2.text
FIX 99 60120.500 739
Till end of file and save the file in c:\sunil by the same name
Can you please help me by making it possible
Thanks in advance
mail me on Email Address Removed By Mod
So, you just want to open the file, parse the 4th column on lines that start with EC1 and increment the value by another value stored in a Text box and the write the results out to the new file?
My attempt at a thought provoking sig.
* Remove ALL assumptions. You'll probably find your problem.
* New to the forums? READ THIS! The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft
* Learn how to fish!
* Subscribing to every thread I post in is like having a book mark in my mind. Every now and then I get to review a fond memory.
* If you find my post helpful do me a 15 second favor and RATE it. (Rate Post. Over there <----)
* Please mark all resolved threads as such. It makes searching for fixes SO much easier!
* Have fun. We aren't on this rock for long, enjoy it.
* Sometimes I'm wrong. When I am I admit it. Never am I malicious. If reading my post and you think otherwise, then it MAY be tongue in cheek. Read it again.
I have a feeling we may never from our new friend Sunil again...... However, for some reason this caught my attention. Here's the way I would accomplish this. I'm only on my first cup of coffee this morning. So, I'm sure there is a more elegant way of accomplishing the same results. Anyone else want to take a crack at it, or suggest a better way of doing the same?
(You'll need to create a simple 1 button, 1 text box form.)
vb Code:
Option Explicit
Private Sub Command1_Click()
Const strTARGET_LINE As String = "EC1"
Const strFILE_DELIMITER As String = " "
Const lngTARGET_ELEMENT As Long = 3
Dim intFreeFile As Integer
Dim strDelimiter As String
Dim strCrLf As String
Dim strPath As String
Dim strErrMsg As String
Dim strFileData As String
Dim strInputLine As String
Dim strLineData() As String
Dim varInputLine As Variant
Dim lngCounter As Long
On Error GoTo ERRORHANDLER
If Not IsNumeric(Me.Text1.Text) Then
strErrMsg = "You must enter a value > 0 in the Text box"
GoTo ERRORHANDLER
End If
' Change to reflect your path or read from text box or other logic
strPath = App.Path & "\Sunil.txt"
intFreeFile = FreeFile()
Open strPath For Input As intFreeFile
Do While Not EOF(intFreeFile)
Line Input #intFreeFile, varInputLine
strInputLine = Trim$(CStr(varInputLine))
If Len(strInputLine) > 3 Then
If Left(strInputLine, Len(strTARGET_LINE)) = strTARGET_LINE Then
My attempt at a thought provoking sig.
* Remove ALL assumptions. You'll probably find your problem.
* New to the forums? READ THIS! The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft
* Learn how to fish!
* Subscribing to every thread I post in is like having a book mark in my mind. Every now and then I get to review a fond memory.
* If you find my post helpful do me a 15 second favor and RATE it. (Rate Post. Over there <----)
* Please mark all resolved threads as such. It makes searching for fixes SO much easier!
* Have fun. We aren't on this rock for long, enjoy it.
* Sometimes I'm wrong. When I am I admit it. Never am I malicious. If reading my post and you think otherwise, then it MAY be tongue in cheek. Read it again.
Dear Darren,
Thanks for the prompt reply,
While adding the path to the file (c:\sunil.txt) I get a error message of 52:bad filename or path
Could u please make the frm and send
Best Regards
Sunil
I am a beginner in VB6 and need lots to learn more,
I thought this tool could be very simple, but it doesnt looks like.
Could u please add the path of the file as c:\sunil.txt as a primary path, later I shall change as required. or can u please add a browser to the frm?help shall be highly appreciated in this regard
Sunil
Got it!!!!!!!
Thanks
I copied the file in the working folder and it worked.
** Now comes for browsing the file,
1. How can the file be browsed with a strpath = App.Path & "filename or path" could u add a browser?
2. I need to select multiple files at 1 go.
3. Message on completion of task, Like "Done" so it confirms that its done else just keep on clicking!!
Thanks once again and still waiting for your reply
Sunil
Sunil, please keep in mind that we could very well be on completely different sides of the world. I would speculate that you are probably 9 to 12 hours ahead of me in time. (I live in Texas. -6 gmt) Also, the things you are requesting are literally spread through out this forum. You'll need to spend a bit of time searching for the pieces you need to use to put your application together. I feel I may have failed you by supplying so much code all at once and not asking that you write some of it first. A mistake I won't make again. Please use the search feature in the forum and look for things you need. Spend some time in the developer and post up what you have. I will help you from there but I will not write the application for you.
My attempt at a thought provoking sig.
* Remove ALL assumptions. You'll probably find your problem.
* New to the forums? READ THIS! The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft
* Learn how to fish!
* Subscribing to every thread I post in is like having a book mark in my mind. Every now and then I get to review a fond memory.
* If you find my post helpful do me a 15 second favor and RATE it. (Rate Post. Over there <----)
* Please mark all resolved threads as such. It makes searching for fixes SO much easier!
* Have fun. We aren't on this rock for long, enjoy it.
* Sometimes I'm wrong. When I am I admit it. Never am I malicious. If reading my post and you think otherwise, then it MAY be tongue in cheek. Read it again.
Only I needed is- I am not able to link the path with the browser or textbox
strpath=app path is not working there, what command shall be used there?
Could u suggest how to link it? only when u r free and having a cup of coffee!!!
Sunil, I want to help you, I really do. However, there is an old saying from a book I refer to from time to time. I paraphrase:
If you feed a man a fish, he eats for a day. However, if you can teach the man to fish, he can eat for a lifetime.
My attempt here, is to teach you how to fish. I hope you take this as a helpful lesson on how to find the things you are looking for in this Forum.
Goto this link and bookmark it. http://www.vbforums.com/search.php
Scroll down and select "Visual Basic FAQ" (Frequently Asked Questions). Then enter some key words to search by. Here's a quick example of the exact question you have "How can I show an open file dialog" the results will show up and you can review the threads. The better your search words the better the results. This particular thread, Index to FAQ's: Classic VB (VB6 and earlier), stands out because it is a "STICKY", or rather it is always at the top of the forum, it "sticks". If you were to review that thread you'd see an index that includes Files. By reading that you'll find the EXACT answer to your question.
You see, we don't mind helping people. But we do wish that people would read the material already in place. That's why we have the http://www.vbforums.com/search.php function, to use material already posted.
Now, when you get finished with this project, if you would like to contribute back to the forum for people in the future who, hopefully, use the SEARCH. You can post your code, no EXE's or DLL's please, to this thread. And/or post the code using the forum tags of [highlight=vb] Your code goes here [/highlight]. This will result in your code looking like the following.
vb Code:
'Your code goes here
Dim strThisIsaSample as string
My attempt at a thought provoking sig.
* Remove ALL assumptions. You'll probably find your problem.
* New to the forums? READ THIS! The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft
* Learn how to fish!
* Subscribing to every thread I post in is like having a book mark in my mind. Every now and then I get to review a fond memory.
* If you find my post helpful do me a 15 second favor and RATE it. (Rate Post. Over there <----)
* Please mark all resolved threads as such. It makes searching for fixes SO much easier!
* Have fun. We aren't on this rock for long, enjoy it.
* Sometimes I'm wrong. When I am I admit it. Never am I malicious. If reading my post and you think otherwise, then it MAY be tongue in cheek. Read it again.
After fishing for these many days, I couldnt get success.
Tried many codes, downloaded many sample codes and tried to insert to get success, but unfortunate.
I request once again if u can help me out with the right fish in form of the code for selection of the
1. file from browser.
2. Selection of multiple file of same extension and apply the code to all files.
The example data does not lend itself to easy analysis as there could be the odd space around that could cause problems.
If you look at the file and your requirements you need to :
1. Identify lines beginning with EC1
2. When you find one look for the 3rd value (where a 'value' is defined as something following a space character)
3. Add to the 3rd value whatever is in Text2.Text
A method might be:
Code:
Option Explicit
Private Sub cmdUpdate_Click()
Dim intFileIn As Integer
Dim intFileOut As Integer
Dim intI As Integer
Dim intPos As Integer
Dim strData As String
Dim dblVal As Double
Dim strRecords() As String
Dim strFields() As String
'
' Allocate a File Number, open, read the entire contents and close the file
'
intFileIn = FreeFile
Open "C:\sunil\000_1642.RAW" For Input As intFileIn
strData = Input(LOF(intFileIn), intFileIn)
Close intFileIn
'
' Open the output file
'
intFileOut = FreeFile
Open "C:\sunil\000_1642_out.RAW" For Output As intFileOut
'
' Split the input data into records
'
strRecords = Split(strData, vbNewLine)
'
' Process each non-null record
' If it's a record type of EC1 then split it into fields
' add whatever is in text2.text to the 3rd field
' replace the original value with the new value
'
For intI = 0 To UBound(strRecords)
If strRecords(intI) <> "" Then
intPos = InStr(strRecords(intI), "EC1")
If intPos > 0 Then
strFields = Split(strRecords(intI), " ")
If UBound(strFields) > 2 Then
dblVal = CDbl(strFields(3))
dblVal = dblVal + CDbl(Text2.Text)
strFields(3) = Format(dblVal, "#0.##0")
strRecords(intI) = Join(strFields, " ")
End If
End If
'
' Write the record to the output filer
'
Print #intFileOut, strRecords(intI)
End If
Next intI
Close intFileOut
End Sub
C:\sunil\000_1642_out.RAW will be a copy of the input file with the updated values
If you need to process multiple files then research the CommonDialog control.
Last edited by Doogle; Jan 18th, 2012 at 01:15 PM.
I found a code for selecting multiple files. as mentioned below, But here I am unable to link the files with the previous code to operate. Could U please help me in this regard,
'_________Code__________
Dim strFileNames As Variant
Dim i As Integer
strFileNames = Split(GetFiles, Chr(0))
With List1
If UBound(strFileNames) > 0 Then
.Clear
'Path is stored in index 0 of array files in index 1...
Label1.Caption = "Files selected from: " & strFileNames(0)
For i = 1 To UBound(strFileNames)
.AddItem strFileNames(i)
Next
Else
.AddItem "(No files selected)"
End If
End With
End Sub
Public Function GetFiles(Optional ByVal sTitle As String = "Open files...") As String
' sTitle: Optional Title of Dialog
Dim sFilenames As String
Dim cdlOpen As Object
On Error GoTo ProcError
' Get the desired name using the common dialog
Set cdlOpen = CreateObject("MSComDlg.CommonDialog")
' set up the file open dialog file types
With cdlOpen
' setting CancelError means the control will
' raise an error if the user clicks Cancel
.CancelError = True
.Filter = "Raw Files (*.raw)|*.raw|All Files (*.*)|*.*"
.FilterIndex = 1
.DialogTitle = sTitle
.MaxFileSize = &H7FFF ' 32KB filename buffer
' set up Common Dialog flags
' same as .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames Or cdlOFNAllowMultiselect or cdlOFNExplorer
.Flags = &H4 Or &H800 Or &H40000 Or &H200 Or &H80000
.ShowOpen
' get the selected name
sFilenames = .FileName
End With
ProcExit:
GetFiles = sFilenames
Set cdlOpen = Nothing
Exit Function
ProcError:
If Err.Number = &H7FF3 Then Resume Next 'Cancel selected - Ignore
MsgBox Err.Description & "(" & Err.Number & ")", vbExclamation, "Open error"
sFilenames = ""
Resume ProcExit
There's a couple of things to note with the code you just posted:
(1) If only 1 file is selected, element 0 contains the full path and file
(2) There's no need to trap an error if the user doesn't select a file. The UBound is set to -1 in that case.
I have adjusted your code (and mine in Post #13) and integrated them. There are now two CommandButtons, one to Create the list of files (cmdGetFileNames) which will populate the ListBox and the other (cmdCreateOutput) which will perform the processing on each file in the LstBox (it removes the file from the ListBox when it's been processed)
Code:
Private Sub cmdCreateOutput_Click()
Dim strFileToProcess As String
With List1
If .ListCount > 0 Then
For intI = .ListCount - 1 To 0 Step -1
strFileToProcess = Mid$(Label1.Caption, InStr(Label1.Caption, ": ") + 2) & .List(intI)
Call ProcessFile(strFileToProcess)
.RemoveItem intI
Next intI
.AddItem "Files have been Processed"
End If
End With
End Sub
Private Sub cmdGetFileNames_Click()
Dim strFileNames() As String
Dim i As Integer
Dim intI As Integer
strFileNames = Split(GetFiles, Chr(0))
With List1
If UBound(strFileNames) <> -1 Then
.Clear
If UBound(strFileNames) = 0 Then
Label1.Caption = "Files selected from: " & Mid$(strFileNames(0), 1, InStrRev(strFileNames(0), "\"))
strFileNames(0) = Mid$(strFileNames(0), InStrRev(strFileNames(0), "\") + 1)
.AddItem strFileNames(0)
Else
'If more than one file is selected the Path is stored in index 0 of array files in index 1...
If Mid$(strFileNames(0), Len(strFileNames(0))) <> "\" Then strFileNames(0) = strFileNames(0) & "\"
Label1.Caption = "Files selected from: " & strFileNames(0)
For i = 1 To UBound(strFileNames)
.AddItem strFileNames(i)
Next
End If
Else
Label1.Caption = "No Files Selected"
End If
End With
End Sub
Private Sub ProcessFile(strFile As String)
Dim intFileIn As Integer
Dim intFileOut As Integer
Dim intI As Integer
Dim intPos As Integer
Dim strData As String
Dim dblVal As Double
Dim strOFile As String
Dim strRecords() As String
Dim strFields() As String
'
' Allocate a File Number, open, read the entire contents and close the file
'
intFileIn = FreeFile
Open strFile For Input As intFileIn
strData = Input(LOF(intFileIn), intFileIn)
Close intFileIn
'
' Create a name for the output file
'
intPos = InStrRev(strFile, ".")
If intPos > 0 Then
strOFile = Mid$(strFile, 1, intPos - 1) & "_OUT" & Mid$(strFile, intPos)
Else
strOFile = strFile & "_OUT"
End If
'
' Open the output file
'
intFileOut = FreeFile
Open strOFile For Output As intFileOut
'
' Split the input data into records
'
strRecords = Split(strData, vbNewLine)
'
' Process each non-null record
' If it's a record type of EC1 then split it into fields
' add whatever is in text2.text to the 3rd field
' replace the original value with the new value
'
For intI = 0 To UBound(strRecords)
If strRecords(intI) <> "" Then
intPos = InStr(strRecords(intI), "EC1")
If intPos > 0 Then
strFields = Split(strRecords(intI), " ")
If UBound(strFields) > 2 Then
dblVal = CDbl(strFields(3))
If IsNumeric(Text2.Text) Then
dblVal = dblVal + CDbl(Text2.Text)
Else
dblVal = dblVal + 0.5
End If
strFields(3) = Format(dblVal, "#0.##0")
strRecords(intI) = Join(strFields, " ")
End If
End If
'
' Write the record to the output filer
'
Print #intFileOut, strRecords(intI)
End If
Next intI
Close intFileOut
End Sub
Public Function GetFiles(Optional ByVal sTitle As String = "Open files...") As String
' sTitle: Optional Title of Dialog
Dim sFilenames As String
' Get the desired name using the common dialog
Set cdlOpen = CreateObject("MSComDlg.CommonDialog")
' set up the file open dialog file types
With cdlOpen
.CancelError = False
.Filter = "Raw Files (*.raw)|*.raw|All Files (*.*)|*.*"
.FilterIndex = 1
.DialogTitle = sTitle
' set up Common Dialog flags
' same as .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames Or cdlOFNAllowMultiselect or cdlOFNExplorer
.Flags = &H4 Or &H800 Or &H40000 Or &H200 Or &H80000
.ShowOpen
' get the selected name
sFilenames = .FileName
End With
GetFiles = sFilenames
Set cdlOpen = Nothing
End Function
Note that it will add whatever is in Text2.Text (or 0.5) to the EC1 value for every file.
Thanks for letting it know it is resolved, but the way you have done it isn't clear until time has been spent reading the entire thread.
The "proper" way to do it (which alters the thread title etc, thus making it immediately obvious) is to click on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
Dear Doogle,
Although this post was resolved, I thought of adding some more codes to it with your kind help.
The code you helped works fine, Now I planned to add some more code to it for getting the date created/date accessed/ date modified for the file selected.
My requirement is :
while the previous code reads the file (while multiple files are selected)
it should read the file name and get the date created/accessed/modified
then run the process
then apply the date created/accessed/modified
then --nextI
I want to insert the code:
Private Sub File1_list()
'use the Nessalco DateStamp Control to report a file's DateCreated,
' to get the selected files date created/accessed/modified
List1.Clear
DateStamp1.File = "File name required which is stored in label1.caption and intI"
txtCreated.Text = DateStamp1.dCreated
txtModified.Text = DateStamp1.dModified
txtAccessed.Text = DateStamp1.dAccessed
End Sub
'After the string process is over and before selection of next file need to insert the code:
Date = DateStamp1.StampFile(LoadPath & File1.FileName, txtCreated.Text, txtModified.Text, txtAccessed.Text)
then continue the procedure till the end of file.
I did it in the procedure while selecting single file but unable to insert while selecting multiple files.
Could you please help it out in inserting it.
Best Regards
Sunil
Last edited by skr706; Jun 16th, 2012 at 11:22 PM.
Hi Mr. Doogle
I need your expert help once again as im unable to add a simple calculation in the same file and same codes.
The codes are as below .
Code:
Code:
. Private Sub ProcessFile(strFile As String)
Dim intFileIn As Integer
Dim intFileOut As Integer
Dim intI As Integer
Dim intPos As Integer
Dim strData As String
Dim dblVal As Double
Dim strOFile As String
Dim strRecords() As String
Dim strFields() As String
'
' Allocate a File Number, open, read the entire contents and close the file
'
intFileIn = FreeFile
Open strFile For Input As intFileIn
strData = Input(LOF(intFileIn), intFileIn)
Close intFileIn
'
' Create a name for the output file
'
intPos = InStrRev(strFile, ".")
If intPos > 0 Then
strOFile = Mid$(strFile, 1, intPos - 1) & Mid$(strFile, intPos)
Else
strOFile = strFile
End If
'
' Open the output file
'
intFileOut = FreeFile
Open strOFile For Output As intFileOut
'
' Split the input data into records
'
strRecords = Split(strData, vbNewLine)
'
' Process each non-null record
' If it's a record type of EC2 then split it into fields
' add whatever is in text2.text to the 3rd field
' replace the original value with the new value
'
For intI = 0 To UBound(strRecords)
If strRecords(intI) <> "" Then
intPos = InStr(strRecords(intI), "EC2")
If intPos > 0 Then
strFields = Split(strRecords(intI), " ")
If UBound(strFields) > 2 Then
dblVal = CDbl(strFields(3))
If IsNumeric(Text1.Text) Then
dblVal = dblVal + CDbl(Text1.Text)
Else
dblVal = dblVal + 0#
End If
strFields(3) = Format(dblVal, "#0.##0")
strRecords(intI) = Join(strFields, " ")
End If
End If
'
' Write the record to the output file
'
Print #intFileOut, strRecords(intI)
End If
Next intI
Close intFileOut
End Sub
The code runs the routine for changing the value of string 3 at the text EC2 and + or - the value of text1.text.
My new requirement here is that i need to copy the string 4 value at the string value 3
Here in above data file string 3 is 11.2 and string 4 is 16.43. same way in full file in need to replace the value of string 4 to string 3 and a option of + or - thr value of text 1.text.
Second problem i have is of large data file errror.
I used the below code for file size
Code:
Code:
Public Function GetFiles(Optional ByVal sTitle As String = "Open files...") As String
' sTitle: Optional Title of Dialog
Dim sFilenames As String
' Get the desired name using the common dialog
Set cdlOpen = CreateObject("MSComDlg.CommonDialog")
' set up the file open dialog file types
With cdlOpen
.CancelError = False
.Filter = "Raw Files (*.raw)|*.raw|All Files (*.*)|*.*"
.FilterIndex = 1
.DialogTitle = sTitle
' set up Common Dialog flags
' same as .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames Or cdlOFNAllowMultiselect or cdlOFNExplorer
.Flags = &H4 Or &H800 Or &H40000 Or &H200 Or &H80000
.MaxFileSize = Public Function GetFiles(Optional ByVal sTitle As String = "Open files...") As String
' sTitle: Optional Title of Dialog
Dim sFilenames As String
' Get the desired name using the common dialog
Set cdlOpen = CreateObject("MSComDlg.CommonDialog")
' set up the file open dialog file types
With cdlOpen
.CancelError = False
.Filter = "Raw Files (*.raw)|*.raw|All Files (*.*)|*.*"
.FilterIndex = 1
.DialogTitle = sTitle
' set up Common Dialog flags
' same as .Flags = cdlOFNHideReadOnly Or cdlOFNPathMustExist Or cdlOFNLongNames Or cdlOFNAllowMultiselect or cdlOFNExplorer
.Flags = &H4 Or &H800 Or &H40000 Or &H200 Or &H80000
.MaxFileSize = 12048 ' Add this to correct the behavior for increasing the no of files selection (max file size error).
.ShowOpen
' get the selected name
sFilenames = .FileName
End With
GetFiles = sFilenames
Set cdlOpen = Nothing
End Function
' Add this to correct the behavior for increasing the no of files selection (max file size error).
.ShowOpen
' get the selected name
sFilenames = .FileName
End With
GetFiles = sFilenames
Set cdlOpen = Nothing
End Function
I also changed the file size to 999999 but not accepted
Please guide to increase the filesize of larger file. If the data file ismore than 2 mb error shows. Then the full file deletes the existing data.
The data file is enclosed for usagehttps://mega.nz/file/kigw1C6I#gJYjPX...A75poX7nS-I90E
Please help to make it work
Thanks
Sunil
skr706 AT gmail.com
Last edited by Shaggy Hiker; Nov 25th, 2021 at 11:45 AM.
Reason: Obfuscated email.
i am not sure that i have seen doogle here for some time
this last post is the same as in your other thread, as both threads are from more than 2 years ago, you should have started a new thread now with links to your old threads
i have supplied some answers in your other thread
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
I do think that a new thread would have been the right way to go. The goal is to get more eyes on the problem, and starting a new thread for this question would do that better. However, there certainly should be only one thread per topic, so I have closed this old thread, so that all the conversation can be in just the one thread, which is here:
If you would prefer to have that new question split out into its own thread, just send a PM to one of the mods, or report your own post. Either one will work.
I also obfuscated your email address. You'll get deluged by bots if you post a real email address to a forum.