Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How Can I Open Dbase IV File In VB?


I want to use a DBase IV file in VB, PLS teach me how to write it?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Open Dbase Files With Different File Extension
I am trying to open and read dbase files that have different file extensions. The file extensions output from the program that I am trying to read have the same name but different file extensions depending on the data that is inside them.

example:
123456.env (envelope file)
123456.veh (vehicle information)
123456.ad1 (administrative information)

The error I keep getting is
<filename>.<extension> isn't a valid name.

Does anyone know of a way to open and read these files without first renaming them?

Any help would be appreciated!

Open DBase IV
hi all,

got a little problem again. i want to open a dBase IV table. right now i have this:

Code:
Connect$ = "dBASE IV"
dbName$ = "p:facturatie"
Set db = OpenDatabase(dbName$, False, False, Connect$)
Set rsKlantenToevoegen = db.OpenTable("REKKL#BK6")
this works perfectly, but now i want to do it the ado way but i'm not quite sure how to do this.
i have:

Code:
Set cn = New ADODB.Connection
cn.Open = "DSN=facturatie"
Set klantenToevoegen = cn.Open(what goes here?)
but i don't know how to move on. anyone has any ideas?

thx
RuffRyder

Open DBF (DBASE IV) In VB6
im using this:


Code:
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim LPath As String
Dim File As String
Dim sql As String

LPath = "C:prueba"
File = "personal.dbf"

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & LPath & ";Extended Properties=dBASE IV;"

rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset

sql = "select * from PERSONAL"
rs.Open sql, conn

and it says that it cannot find the Xbase file, what can be the problem?
thanks

Check Is DBase Is Open
Hello I've created a dbase called MyConn. Now I want to check if it's already opened like this.

Code:
If MyConn.open = true then
MsgBox "it's open"
Else
MsgBox "it's closed"
End If
But it doesn't work. I get a wrong statement in the first line.
Could someone help me with this?? Thanx in advance.

Open Record Set On DBASE IV Using Vb 6.0
can someone help me get this to work faster/better i am using vb6.0 and trying to open a dBASE IV "zipcode" DBF
i've tried to get the database to open directly and have run out of ideas
so i made a datacontrol and set its properties as follows:

.visible=false
.connect=dbase IV;
.DatabaseName=C:my documents
.Default type= 2-usejet (UseODBC Fails to open the DBF)
.record type=1-Dynaset(all seem to run about the same speed)
.recordsource=NCs_Zip

i then use the datacontrol to open the database as follows
this way is VERY SLOW (about 35 seconds to a min' to get a response!)
the Zip code database(NCS_ZIP) has @ 98000 records and needs to stay in DBASE IV format ( i use a similar code in access to get info from an access table and it is very fast) so i think there must be a better way to directly connect to this NCS_Zip.dbf so it will search/return info faster.


Dim tempzip As String
tempzip = Zip.Text
Dim db As Database
Set db = Data2.Database
Dim rs As Recordset
MousePointer = vbHourglass

Set rs = db.OpenRecordset("select distinctrow Ncs_Zip.City,Ncs_Zip.State from Ncs_Zip where Ncs_Zip.Zip= '" & tempzip & "'")
If rs.EOF Then
City.Text = ""
State.Text = ""
MousePointer = vbNormal
MsgBox "Zip code not found"
Exit Sub
Else
City.Text = rs!City
State.Text = rs!State
MousePointer = vbNormal
End If

thanks ahead of time for your help

hunter

Open/Append DBase IV Table In VB6
Hi there,

I'm struggling with trying to get VB6 to open a dBase IV file. I have tried every connection string known to man, and none of them will open the file. All tell me that I have an invalid file name, even though the file is exactly where the program says it "isn't". Anyhow, all I want to be able to do is open a dBase IV file, and add a record to the end of it using data entered in text boxes on the form (no deletions, no finds, nothing else). Can't seem to find anything similar online, so could anyone point me in the right direction, please??

Code:Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim rPath As String
Dim rFile As String
Dim rPathFile as String

rPath = "C:TerraX"
rFile = "TerraX.dbf"
rPathFile = rPath & File

conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & rPathFile & ";Extended Properties=dBASE IV;"
          
rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
Have I done something wrong with the connection string?? Also, have this part here (for when they click "Update" - is under a button click sub):

Dim ar as New ADODB.Recordset
Dim db as Database

Set db = OpenDatabase("c:TerraX", False, False, "dBase IV;")

Set ar = New ADODB.Recordset

ar.Open
ar.AddNew

ar!StreetNo = txtStreetNo.Text
'(...etc for 5 columns)

ar.Update

This errors out too. I have a feeling that I only need to open the file when the form opens, but am not sure how to 'call' it when the button is pressed... afraid I am guilty of trying to find examples online for this, so it's a bit cobbled. I imagine I need not say that I know nothing about ADO!

Thanks!








Edited by - akira71 on 2/11/2008 6:10:25 AM

How Do I Link A DBase File To Access If The File Doesn't Have .DBF Ext?
I am trying to create a VB6 program that makes a temp link to a dBase file, reads the data and then breaks the link. The files that I need to link with do not end with .DBF

Everything works fine if I use files that have a .DBF extention. I have this same problem with Access 2000.

The code I am using to make the link to the access file is:

Public Function Create_Dbase_Link(Access_DB As String, LinkName As String, dBase_Path As String, dBase_Table As String)
    Dim Cat As New ADOX.Catalog
    Dim TbLink As New ADOX.Table
    Dim Pos As Integer
    
    Cat.ActiveConnection = "Provider=" & ADO_Provider & ";Data Source=" & Access_DB
    
    If Right(dBase_Path, 1) = "" Then
        dBase_Path = Left(dBase_Path, Len(dBase_Path) - 1)
    End If
    
    Pos = InStr(dBase_Table, ".")
    If Pos > 0
        dBase_Table = Left(dBase_Table, Pos - 1) & "#" & Mid$(dBase_Table, Pos + 1)
    End If

    With TbLink
        .Name = LinkName
        Set .ParentCatalog = Cat
        .Properties("Jet OLEDB:Create Link") = True
        .Properties("Jet OLEDB:Link Provider String") = "dBase III;HDR=NO;IMEX=2;DATABASE=" & dBase_Path & ";TABLE=" & dBase_Table
        .Properties("Jet OLEDB:Remote Table Name") = dBase_Table
    End With
    
    Cat.Tables.Append TbLink
    DoEvents
    
    Set TbLink = Nothing
    Set Cat = Nothing

End Function

Where
ADO_Provider = "Microsoft.Jet.OLEDB.4.0"

The error I get is:
Runtime Error '-2147217860 (80040e3c)';
The microsoft Jet database engine could not find the object 'OCT28_02'/ Make sure the object exists and that you spell its name and the path name correctly.


Any ideas would be a great help thanks

Alan

Opening A Dbase File With Ext Other Than .dbf
Sorry if I do anything wrong. I'm a newbie.
Well I need help in opening a dbase file that has an extension other that .dbf

I'm using the following code:


Code:
If UsePath Then
tdfTmp.Connect = "dBASE III;DATABASE=C:VB ProgramsMapTrak"
Else
tdfTmp.Connect = "dBASE III;DATABASE=" + AppPath
End If

tdfTmp.SourceTableName = "cropdata.dat"
dbsRGU.TableDefs.Append tdfTmp
but it gives me an error that the file "cropdata" cannot be found, since it doesn't read in the .dat extension it looks for a cropdata.dbf.

Any help or suggestions would be greatly appreciated.
Thanks in advance.

Duplicating A Dbase File With Vb??
Hi... I was just wondering how I can duplicate my dbase file with vb6? Let say, I click a button [Backup DBase] and it will backup the whole dbase, making a copy: dbasebackup.mdb so that it can be used if the original copy gets corrupted or something.

And another question, how can I use the Label to link to a file, eg: when I click Label, it will open the README file (both .HTML and .TXT file) in the same folder as the application??

Read DBase IV File
I have a dBase IV file which was made in excel and saved as a dBase IV.

I wish to read this file in my VB program but can not find a workable solution

Can anyone help?

Dan

Updating A Dbase File
Can someone give me some insight as to how to edit and then update a dbase file?
The error "Operation is not supported for this type of object" is generated when I try to execute the update statement in the following code:

Code:
strFileName = InputBox("Enter path to streets.dbf", _
            "Create Street Label Fields For Internet Apps", "x:wrkareagisrett")
        Set dbCurrent = OpenDatabase(strFileName, False, False, "dbase IV;")
        Set rs = dbCurrent.OpenRecordset("streets")
        Do Until rs.EOF
            rs.Edit
            rs.Fields("myabbtype").Value = rs.Fields("st_type").Value
            rs.Update
            rs.MoveNext
        Loop
        dbCurrent.Close

 


Create DBase V File
I need a sample on how I can create a DBase V file using Visual Basic. Also, included with the sample is how to create a table, some fields and indexes.

Thanks in advance.

Updating Dbase .ndx File Via VB6 - Please HELP!!
I wrote a vb 6.0 program which uses a datagrid and the following logic (partial code) to access a dbase file:

Does anyone have any ideas on what i can do to update the index file for a dbase file?




'setup connection for customer data
    Set conCust = New ADODB.Connection
    conCust.ConnectionString = "Provider=MSDASQL.1;" & _
            "Extended Properties=;DRIVER=" & _
            "Microsoft dBase Driver (*.dbf);" & _
            "DefaultDir=" & strPathB & ";DriverId=21;" & _
            "FIL=dBase IV;MaxBufferSize=2048;" & _
            "PageTimeout=600;UID=admin;"
            
    conCust.Open
        
    Set oRsC = New ADODB.Recordset
    If strCustOrd = "Y" Then
        strSQLB = "SELECT * FROM hcustome" & " where " _
                    & "('" & strCust & "' = custno or '" & strCust & "' < custno) " _
                    & strOrder
    Else
        strSQLB = "SELECT * FROM hcustome" & " where (class = '" & strClas & "') and (" _
                     & strStor & " <= val(store)) " _
                    & strOrder
    End If
    

    oRsC.Open strSQLB, conCust.ConnectionString, adOpenForwardOnly, adLockOptimistic, adCmdText
 
    Adodc1.ConnectionString = conCust.ConnectionString
    Adodc1.RecordSource = strSQLB
    Adodc1.Refresh
    
    Set DataGrid1.DataSource = Adodc1
    DataGrid1.Refresh

The program fills the data grid, allows updates, deletes and changes.

However, I am at a loss on how to update the index (.ndx) file when I add or delete records. In fact, I don't think the program is even accessing the .ndx file becuase I have renamed it and did not get an error.


Thanks

Geod



 

Edited by - geod on 3/28/2003 4:18:54 AM

Connect To A DBASE File
I need to connect to a DBASE file so I can show it in a data grid on my form. I set an ODBC driver for the directory of the DBASE file, but there are errors when I try to set the table. Is there an easy way to connect to a DBASE file and show the results in a data grid using ADO or DAO?. Thanks,

Chad

How, If You Can, Create A DBASE IV File In VB?
Can you create a dBase file in Visual Basic 6?

Thanks
TurboSTud

Updating A Dbase File
Can someone give me some insight as to how to edit and then update a dbase file?
The error "Operation is not supported for this type of object" is generated when I try to execute the update statement in the following code:
Code:
strFileName = InputBox("Enter path to streets.dbf", _
            "Create Street Label Fields For Internet Apps", "x:wrkareagisrett")
        Set dbCurrent = OpenDatabase(strFileName, False, False, "dbase IV;")
        Set rs = dbCurrent.OpenRecordset("streets")
        Do Until rs.EOF
            rs.Edit
            rs.Fields("myabbtype").Value = rs.Fields("st_type").Value
            rs.Update
            rs.MoveNext
        Loop
        dbCurrent.Close

Opening Dbase File Through ADO In VB6
Hello,

I am trying to open a Dbase File using VB6 ADODB connection. I am getting this error message: "Path is not a valid path. Make sure that the path is spelled correctly and that you are connected to the server on which the file resides."

I know and know that the 2 conditions are met. The code is as follows:
___________

Private Sub Form_Load()

Dim Conn
Set Conn = CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:CUSTOMER.DBF;Extended Properties=DBASE IV"
End Sub
___________

I know you can open dbf with ADO. and as far i can see in the documentation, the 'extented properties' paremeter is important, i tried the above and also tried one other format:

... Extended Properties=""DBASE IV;"";"

and that gave the same error message.

I can open the dbf file easily from a DAO control, by specifying the table name in 'recordsource' and 'dbase IV' in Connect property; but I want to do it in ADO so i can have more flexibility in controlling the record source at run time.

Thank you for any input,

Regards and God bless

vchell

Problem Opening A DBase File Within VB6
I'm having trouble opening a dBase File with the generic data control. I set the connect property to dbase 5.0 (I've tried 3 and 4 as well) and the error I recieved at first was 3107 : Couldn't find the Installable ISAM. After some googling, I found some links that said to re-register the dll associated with dbase files (which I did). This did not fix the problem. Another link said to reinstall vb 6 using a custom installation and select the ISAM data drivers. I tried that as well. After that, the error I recieve now is 3044, not a valid path. I'm running windows XP SP2 and working with ms office 2k. Any help would be appreciated.

Connection To DBase File With Extentions Other Then .dbf ?
I,m trying to import 13 separate dBase files from an existing application into MSSQL2000. They each have different custom file extensions. The files are readable only if I change the extensions to .dbf - (Microsoft.Jet.OLEDB.4.0 w/Extended Properties=dBase IV). Is it possible to open dbase files without the .dbf extension?

Opening A Dbase File With ODBC
I am trying to open a Clipper dbase III file and get the error:
[Microsoft] [ODBC dBase driver] Index file not found
I do not use any ndx indexes with the dbf. I do use nsx indexes but I do not need to open any indexes for what I want to do.
How do I get around the error?
Below is my code

Private Sub cmdExport_Click()
    Dim StrSql As String
    Dim dbRts As Connection
    Dim RsRts As ADODB.Recordset
    On Error GoTo ProcErr
    StrSql = "Select JOBNUM,ADDR,ZIP from Job " & _
             "WHERE EMPTY(MAPCODE) = TRUE "
    Set dbRts = New Connection
    dbRts.CursorLocation = adUseServer
    dbRts.Open "PROVIDER=MSDASQL;dsn=DBase3;uid=;pwd=;database=C:RTSDataJOB.dbf"

    Set RsRts = New ADODB.Recordset
    RsRts.Open StrSql, dbRts
    Debug.Print RsRts.recordcount
    Exit Sub
ProcErr:
Debug.Print Err.Description, Erl
End Sub

Thanks,
Dan

Request For DBase III File ** RESOLVED **
Has anyone got a small dBase III file they could post to this thread? I just want a file with a couple of records in to prove if a theory will work. If you have just zip it up and attach to a follow up post to this one.

Thanks

~ Shandy, Ex Microsoft VB MVP 2004/5 has a technical blog.
How To Get Your Questions Answered | Posting Guidelines | Search Facility | FAQs
Why not send Serge a postcard?

Edited by - Shandy on 1/5/2004 6:12:44 AM

Opening A Dbase File And Getting Its Recordset
Hi!

how do I open a dbase file in Visual Basic using DAO and then get the recordset. is it possible to equate the DAO recordset to ADO recordset?

thanks.

How Do I Create An Index On A DBASE File?
Is there a way to create an index file using VB on a dBASE file? I know you can use ADDIndex in Delphi, but i am not sure whether it's simplier using VB? Can anyone help? Thanks in advance.

How To Hide A .rtf File And Password Protect Dbase
Hi,

Does anyone know, through Visual Basic code, how to hide a rich text file? If you right click a rich text file you can check 'Hidden'. I would like to know how to do this automatically. Also, I will need to password protect my database on the network. How can I grant access to the database through my program? ....how do you feed the password to the database from the program during the program execution?

Any help would be greatly appreciated.

Thanks.

Connecting To And Adding Records To DBASE File
Hello folks,

I've successfully written an export routine that takes data from a recordset and exports it to a structured text, delimited text, and an access file. I am having a hell of a time doing the same for a 'dBASE' file. I was successfull before using DAO, but am having problems with ADO.

The actual '*.dbf" file is created correctly. I now use the following connection string to open it:

cConnStr = "Provider=MSDASQL;Persist Security Info=False;Extended Properties="
cConnStr = cConnStr & Chr(34)
cConnStr = cConnStr & "DSN=dBASE Files;"
cConnStr = cConnStr & "DefaultDir=" & cFullPath & ";Data Source=" & cFileName & ";"
cConnStr = cConnStr & "SourceType=DBF;"
cConnStr = cConnStr & Chr(34)
cnExports.Open cConnStr

Then I open a recordset on which I will use the AddNew:

rsExports.Open cFileName, cnExports, adOpenDynamic, adLockOptimistic, adCmdTableDirect

It seems to open, but a call to the AddNew method responds that the recordset is 'Read Only'.

Any help would be much appreciated.

R/S


Roger Bogh
Banana Republic of California, Lights Out Buddies...

Can I Create An Index For A DBase III File Using ADO/ADOX V2.5+?
Does anyone know if I can create an index on a dBase III file using either ADO or ADOX? Any pointers welcome

~ Shandy, Ex Microsoft VB MVP 2004/5 has a technical blog.
How To Get Your Questions Answered | Posting Guidelines | Search Facility | FAQs
Why not send Serge a postcard?

How To Export Dbase (*.dbf) File To Microsoft Access Database
I want to export Dbase file (*.dbf) to Microsoft Access database through Visual Basic. Is there any way that i can open Dbase file in a shared mode through Visual Basic

How To Update Dbase File (*.dbf) With Index (*.ntd) In A Shared Mode
Hi!

What i want to know is that if a Dbase program has opened a Dbase
file (x.dbf) with index (.ntx) file then is it possible to open the same
file with index through Visual
Basic at the same time, also can i update,add any record which will
update the .ntx file through VB



Best Rgds,
Sunil



************************************************** **********************
This message and any attachments are confidential to the ordinary user of
the e-mail address to which it was addressed and may also be privileged.
If you are not the addressee, you may not read, copy, forward, disclose
or use any part of the message or its attachments. If you have received
this message in error, please notify the sender immediately by return e-mail
and delete it from your system.

Internet communications cannot be guaranteed
to be secure or error-free, as information could be intercepted, corrupted, lost,
arrive late or contain viruses. The sender, therefore, does not accept liability
for any errors or omissions in the context of this message, which arise as a
result of Internet transmission.

Any opinions contained in this message are those of the author and are not
given or endorsed by K. Raheja Corp. or the office through which this message
is sent unless otherwise clearly indicated in this message and the authority of
the author to so bind the K. Raheja Corp. entity referred to is duly verified.
************************************************** **********************

Read A Dbase IV File In Visual Basic 6 Wih WinXP
Is there an easy way to read a dbase IV file in Visual basic 6 on a WinXP SP2 platform?

Thanks!

-John

How To Hide A Rich Text File And Password Protect Dbase
Hi,

Does anyone know, through Visual Basic code, how to hide a rich text file? If you right click a rich text file you can check 'Hidden'. I would like to know how to do this automatically. Also, I will need to password protect my database on the network. How can I grant access to the database through my program? ....how do you feed the password to the database from the program during the program execution?

Any help would be greatly appreciated.

Thanks.

How To Access Dbase File (*.dbf) Through Visual Basic In Shared Mode
I want to open a Dbase file through Visual Basic in a shared mode,
i tried using DAO object but din't worked.

If a Dbase program has opened a file (x.dbf) in shared mode and at
the same time a Visual Basic application accessing the same file, then
it gives me an error ---

Is there are method or so to solve this issue

Kind rgds,
Sunil Dhyani


************************************************** **********************
This message and any attachments are confidential to the ordinary user of
the e-mail address to which it was addressed and may also be privileged.
If you are not the addressee, you may not read, copy, forward, disclose
or use any part of the message or its attachments. If you have received
this message in error, please notify the sender immediately by return e-mail
and delete it from your system.

Internet communications cannot be guaranteed
to be secure or error-free, as information could be intercepted, corrupted, lost,
arrive late or contain viruses. The sender, therefore, does not accept liability
for any errors or omissions in the context of this message, which arise as a
result of Internet transmission.

Any opinions contained in this message are those of the author and are not
given or endorsed by K. Raheja Corp. or the office through which this message
is sent unless otherwise clearly indicated in this message and the authority of
the author to so bind the K. Raheja Corp. entity referred to is duly verified.
************************************************** **********************

Can't Open Object Using .aspx File. Can Open With .htm File
I’m trying to use vbScript to open an excel application (I’m also going to do word).


Sub Btn1_onclick()
    call OpenWorkbook("c: emp est.xls")
End Sub

Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub

This code works in a .HTM file but not an .aspx file.

I get this error -

Microsoft VBScript runtime error: ActiveX component can't create object: 'Excel.Application'

Why wouldn't it work in an .aspx file?


 

Open Dialog To Open Text File With Notepad?
Hello,
Can someone please help me to open a text file with the Common Dialog control? I have seen your tutorial and it makes sense, but it uses a rtb control instead of opening the file with notepad as i would like.

HERE IS CURRENT CODE:

(Other properties were setup in properties pages)

Private Sub Command1_Click()
cdlOpenFile.Filter = "Text File (*.txt)|*.txt|All Files|*.*"
cdlOpenFile.ShowOpen

End Sub

THANKS!!!

What Is The Line To Open A File.. Open ?????? For Input As #RecordFile
in my program i have this line, but it doesnt work

Open ("E:Visual BasicWork
ecord") For Input As #Filehandle1

but i says bad file name or number "error 52"
what am i supposed to type without using commondialog boxes etc

Open Excel And Make It Open A Text File
Hey, friends,

I need to open excel, make it open a comma delimited text file, format it, and after that, end my application leaving the user in excel... i am starting as follows but at that point, excel does not appear, why? (it seems to work but i can not see excel)

Quote:





Dim XlApp As Excel.Application
Set XlApp = New Excel.Application
XlApp.DisplayFullScreen = True






Thanks for your help!

Heyner

AutomationError While Attempting To Open A File With Document.open
I am getting an AutomationError while attempting to open a file with Document.open method with the word.application object. Below is the code I am using. Oooo its frustrating when something as easy as opening a file gets you.
Dim wb As New Word.Application
'Notice here I attempted using the document object
'and assigning it but without success hence the '
'Dim wbDoc As Word.Document
Set wb = New Word.Application
' Set wbDoc = CreateObject("Word.Document")
wb.ChangeFileOpenDirectory ImportDir
wb.Documents.Open FileName:=iFileName, ConfirmConversions:=False, Visible:=True
my file is not a word file so I am turning the confirm conversion to false. the file name is rt010117.034. It is a very simple text file with page breaks hence the desire to open with word.

Thanks

WMI Read Open Mode Column In Open File From MMC
Hi,

I have a requirement to capture whether the user is reading a file or modifying a file in a network share.

I have used resource.path and resource.user to get "Open File" column and "Accessed By" Column under Open Files in Shared Folder of MMC, that details what share is accessed and who accessed it.

Is there a way to capture, what the user is doing whether he is reading or writing to a file. This information is captured under "Open Mode" column in Open Files option.

Can anyone guide me how I can extract this infomation.

Thanks
Suresh

Detecting Adobe Reader Open With PDF File Open
I use this to close Adobe Reader if the instance of Adobe Reader is open blank (no PDF file Open). How do I detect an instance of Adobe Reader that is open with an unknown PDF file open? Adobe Reader open blank returns a handle base on the window title Adobe Reader. Adobe Reader open with a PDF file open returns a handle base on What ever PDF file that is open.pdf Adobe Reader. Appears I need to read the window title. But how?


Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam _
As Long) As Long
Dim iHwnd As Long


'close a window
On Error Resume Next
sTitle = "Adobe Reader"
iHwnd = FindWindow(0&, sTitle)
If iHwnd > 0 Then
iReturn = PostMessage(iHwnd, WM_QUIT, 0&, 0&)
End If

How To Open The Open File Dialogue Box In The Same Directory?
Hello!
How do I open the Open File Dialogue Box in the same directory as the program exists?

Using The Open Statement To Open A Text File
Can I enter the pathname as a relative path or do I have to open it with an absolute path?

Open Dialog - Open Folder Not File
I need to select a folder to work in, but the common controls only allow me to select a file. This will not work since the folder I want to work in only has other folders in it. Is there a way to select a folder instead of file in an open dialog?

MD5 An OPEN File Or Get Filedata From An Open File
I want to MD5 an open file but the problem is I can't read the file info when it's openend , but I can't close it cause it's an exe and I'm not the one who opens it as first but I only want to read the data and md5 it

Error &"invalid Method &" When Im Using To Open Movie File With Mp.Open Plist.list(0)
Any 1 tellme how this error occure
i m using open command to open movie file from list box
but movie play also give me error " Invalid Method" using this code
mp.open plist.list(0)
mp.play ' here this line give error'

in this method playstatus = mpPaying condition is not working if i open file with mp.FileNme = plist.list(0) then above condition works fine

so pleaee tell me accept mediaplayer any way to play all movie file from list box

Open A File, Close It, Open Next.
I've got my searching code going now, but I'm looking for a way to tell the program to load each file in a directory, one at a time, search, close it, move on to the next. And I have no clue how to do that. Any ideas?

Thanks in advance.


-Jer

Open A File, Close It, Open Next.
I've got my searching code going now, but I'm looking for a way to tell the program to load each file in a directory, one at a time, search, close it, move on to the next. And I have no clue how to do that. Any ideas?

Thanks in advance.


-Jer

How Do I Open A Notepad File ONLY If It Is Not Already Open?
I don't want it to be open more than once.

Thanks.

How Can I Open An &"Open File Dialog Box&" In VBA For ACCESS 2000 ?
So, the question is in the subject :

How can I open an "Open File Dialog Box" in VBA for ACCESS 2000 ?

Thanks for your answer !

Kcnarf's Lord !

Recurse Subfolders To Open 1 Xl File &amp; Copy 1 Wksht To Master Summmary File
Hi all.

I need a bit of help in writing code to recurse sub-folders, open the only XL file in there & copy the master sheet of that file (which has the same name as the sub-folder) to a master summary file.

Here is the over all scenario.

I am the financial manager for a small company and I down load our bank accounts, visa accounts & payments made by direct credit (DC’s) thru Internet Banking as CSV files. This is no problem as I have macros that import & format the data as required to the requirements of the account type.

The DC’s are slightly different as I may have up 10 CSV files per month, one per transaction which may have up to 30 creditors per transaction. I use a macro to import the CSV file/sheet into a summary XL file for the month.

Here is my challenge – I now want to summarise these monthly summaries into one annual summary for collation & reporting purposes.

To do this I need to the following - But I am not sure if this “pseudo-code” is possible or I am on the right track.


1.    Open the Master annual summary (MAS) file
2.    ascertain & record in an array the all the subfolders
3.    Loop thru the subfolders & open the required work book
4.    Copy the summary sheet (the copied CSV sheets are still in the summary file) of the workbook
5.    Close the monthly summary workbook
6.    Paste the sheet into MAS
7.    After looping thru & save the MAS.

But I am not sure if this “pseudo-code” is possible or I am on the right track.

I have code that recurses & lists files, copies files, backup files, rename files, but not actually open files in the sub-folders & do things by looping thru.

I think I read some where that an array cannot actually open files in subfolders but you loop thru the sub-folders, use the array to go to the individual sub-folders and open the file to do stuff.

Added info - the structure I have is like this

Folder structure - DCPayments8 (where 08 is August & all the folders are named as mm & the summary file is “DC0708.xls”
Cheers

Lionel Downunda

Excel - On A Button Event, Open Another Closed File, Post Changes, Close File
Really new to VBA but coming along.

I hope that this hasn't been addressed already in this forum, I looked but didn't find it ...

The issue I can't resolve is this: I have a shared workbook with multiple sheets, essentially counting instances of answers from lists (lots of 'em) across all sheets. These are being summed in my 'summary' sheet (countif). Upon a button event (available on each sheet), I am posting from the summary to the summary2 sheet ... using the following:

Sub GetAns()
Sheets("Summary2").Select
Range("D5").Select
Selection.Offset(0, 0) = Application.Sum(Sheets("Summary").Range("D5").Value, Sheets("Summary2").Range("D5").Value)
Selection.Offset(1, 0) = Application.Sum(Sheets("Summary").Range("D6").Value, Sheets("Summary2").Range("D6").Value)
.+
.+

Long story, but I have Summary (current tally) and Summary2 (total tally)

The thought is this - this book is to be shared by 50+ users who will update it periodically yet constantly. What I would like to accomplish, essentially, would be to to have 'summary2' as an external closed book that accepts the posting from each save from the open books 'summary' sheet ... using vba (ActiveWorkbook.Save) in my GetAns sub ... basically 'on save, add this value to that value in that book' ... 'that' book will be a running tally of all users answers ...

Sorry, I hope this makes sense ... Can anyone help ?

Copyright 2005-08 www.BigResource.com, All rights reserved