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





See Related Forum Messages: Follow the Links Below to View Complete Thread

How To Retrieve Ms Excell Data (sheet Name) To Sql Table Using Vb (Data Conversion)
hi
i have problem to retrieve a ms excell data to sql table (i'am using sql 2000) using visual basic.
then another problem is after the conversion process, how to retrieve the certain sql field (example name field) and
make it into shortname (example robert joseph to robert) without adding the last name and update it into sql table.
my limitation for the shortname is 12 character.
plss help me

Excell Data
Hi,
I'm new with VB, i have excel data, im trying to sort the data with highest
percentage and produced the result including the name and few information
which can be lookup together with the sort result. so how
can i do this. i try to do this but i dont know how can i bring others
information Please help me for the jump start.

Thanks

Readwrite From And To Txt File
I want to store my sql datasource name in a txt file and place it in a connection string.
how can I open and reed or write a string from and to a file?

ReadWrite From The Registry
Hi,

Is there a way to read and write from the Registry without
the use of command getSetting?
I don't want to read and write my parameters under VB directory, Because my application may run on computers without that directory. Is there a way to do that?

Thanks.

Readwrite Operations
I am making a game launcher and it launches custom maps for a game called QUAKE 3. Basically, it writes the name of some maps (actual files) to a text file. QUAKE 3 can exec The only problem is... QUAKE 3 adds in the .bsp file extention in the game. The map name is taken from: File2.FileName
So when in the game, it can't execute the map, and it thinks I'm specifiying smash3.bsp.bsp. So I would like to know how to get rid of the .bsp in the text, after my app outputted to the text file. Anything... ANYBODY!?

-dead

Looping Data To Excell
Ok, here is my issue.. I have posted this before but never got a clear answer... I have about 25 variables that I need to write to excel... all 25 to one row - one row at a time.

I can write single variables to single cells and multiple variables to a single cell… what I cant do is write all 25 variables to 25 cells in a single row.

What I need is a way to write all variables to a row then later add different variables to a new row in the same file… I am completely lost.

I have seen posting on how to loop the search for an available row... but I can not seem to get it work.

Here is what i have so far...

Code:
Dim oExcel As Excel.Application
Dim oWB As Excel.Workbook
Dim oWS As Excel.Worksheet

Set oExcel = New Excel.Application
oExcel.Visible = False

Dim oRng1 As Excel.Range

Set oWB = oExcel.Workbooks.Add
Set oWS = oWB.Worksheets("Sheet1")

oWS.Range("A1").Value = txtDate(1).Text ' <-- one variable to one cell

oWB.SaveAs ("c:
esearch_data.xls")

Cleanup:
Set oWS = Nothing
If Not oWB Is Nothing Then oWB.Close
Set oWB = Nothing
oExcel.Quit
Set oExcel = Nothing

Serial Data To Excell
I have a sensor the sends ascii data to the computer by serial, I need a exe that will read that data and put it into an excell document, and move down a line everytime it gets a new reading, But Im not sure what I need to put into vb6 to accomlish this?

Excell Data From Query
Hi

I am trying to use excell to connect to a ODBC database. It works, but I dont know how to use the data. I want to run the query and then put the results in variables, so I can place them on the sheet where I want. Any Ideas?

Thanks

Send Data From Vb To Excell
hi
i want to send some numeric data to excell sheet.

i want to develope a graph depending on that values.

chowdarypavuluri@yahoo.co.in

Thanks & Regards

Exporting Data To Excell
Hi there ,

How Could I Export the data that has been stored in Access DB using VB 6.0 To Excell Worksheet .

It's Uregent , Please any one who has an idea .

Best Wishes

Mohammed

Sending Data To Excell
Hello

I have a programme that creates a notepad document, how do I send the contents of log.txt
to open in MS Excel. I don't want to see log.txt at all.

thanks in advance
V

ReadWrite IPTC Tags?
Anyone know how I can read and write the IPTC tags in graphics files?

ReadWrite To Text Files.
Hello,

I am looking for a good information source that can explain in detail the different methods of implementing the readwrite to file methods. Most of the tutorials that I have been looking at only scratch the surface (basically giving me just enough rope..). Any assistance would be greatly appreciated.

ReadWrite To Random File
Using the following code I can read and write to a random file. How can I update the file with new info? (right now I can only Append to the file; ie, old data still there)

Please help!

--------------------------------
Option Explicit

Private mEmployees As Collection
Private mstrFilePath As String
Private mstrHighestKey As String
Private mintFileNumber As Integer

Private Type udtEmployee

strLastName As String * 15
strFirstName As String * 15
strDeleteCode As String * 1 'D = deleted; A = active

End Type

Dim mudtEmployee As udtEmployee
-----------------------------------------------------
Public Sub OpenNewFile()

Open strFilePath For Random As #mintFileNumber _
Len = Len(mudtEmployee)

End Sub
------------------------------------------
Private Sub ReadFile()

Dim intNumberRecords As Integer
Dim intIndex As Integer

mintFileNumber = FreeFile
mstrFilePath = App.Path & "List.dat"

Open mstrFilePath For Random As #mintFileNumber _
Len = Len(mudtEmployee)
intNumberRecords = LOF(mintFileNumber) / Len(mudtEmployee)

End Sub
------------------------------------------------------
Private Sub WriteRecord(strKey)

Dim intRecNum As Integer

intRecNum = Val(strKey)

Put #mintFileNumber, intRecNum, mudtEmployee

End Sub

Textbox Data Transfer To Excell
Hello! I have a UserForm that I have created for an Excel spreadsheet. In this UserForm, I have a Textbox that is set up to word wrap so that users can enter a long string of information. In order to have it appear properly in Excel, I have merged a large section of cells and set them up to word wrap. The problem I am having is that I can type a ton of info into the UserForm TextBox, but I get the "#Value" error in the Excel field. If I just type a couple of lines of info into the TextBox and submit, it works fine (and will even word wrap once). I have made sure that I am not typing in too much info for the space available in my merged cell. I have also changed the MaxLength property all the way up to 100,000,000 and it doesn't make any difference. I haven't been using VB for very long and I cannot figure this out!!! Please help!!

Thanks,
Brandon

Export Textbox Data To Excell
hello

can someone share with me some code that can take data inputted into various textboxes, and then those textboxes data can be exported to an excel file, or some way to take data in vb and export them to an excel spreadsheet? thank you.

Excell Numerical Data Comparison
I have two columns of numerical data A and B. Number of rows in column A > Number of rows in column B. Sum of numbers in column A = Sum of numbers in column B. So you have a scenario where maybe Sum of 1, 2, or 3 or more cells in Column A = a cell in column B. I am trying to write a program with the most efficient algorithm or code for making this comparison in excel and making these many to one mappings. Please help

Export Data To Excell From Msflexgrid
Hello All members
How can i make Exporting Data To Excell from Msflexgrid!!!?
thaks alot for advice


Egyptian Man

Writing Data To Cells In MS Excell
The wierdest thing happened. For some reason I can't put a value in the cells. It may be a result of the Row Insert I do but I don't know. Maybe the code can explain.

Code:
        For RowCount = 0 To UBound(aryTasks)
            Row = Row + 1
            Rows(Row).Select
            Selection.Insert Shift:=xlDown
            Set aRange = .Cells(Row, DATECOL)
            aRange.Value = dt
            Set aRange = .Cells(Row, MILEAGECOL)
            aRange.Value = miles
            Set aRange = .Cells(Row, TASKCOL)
            aRange.Value = aryTasks(RowCount)
        Next
        Set aRange = Nothing


Sure appreciate your help.

Scott
The worst thing about wearing glasses is them being on your face.
Nothing is impossible, it just looks that way.

How To Store A VsfGrid Data Into An Excell
Hi!
I,m using access for database & connect through ADODB. It work properly.
But i want to Restore that data which i store in datagrid, into an excell file.

Thks.

Need Help Quickly Please!! (putting Data In Excell Sheet)
Code:
'Put data in excell sheet
Dim A As String, B As String, C As String, D As String
ColA = LTrim(RTrim("a")) & LTrim(RTrim(Str(i)))

For i =1 to 50
Sheet.Application.range(A).Value = "66"
Next i

To put something in a spreadsheet you do Sheet.Application.range(ColA).Value = "66"

"ColA" is which square it goes into (ie A5 or B3).
So i set colA to eqal a(i), so thats column a and i up or down. And I have to fill 50 cells in each column (A1 to A50)

Ok now the problem is when I do


Code:
Sheet.Application.range(A).Value = "66"

the i in
Code:
ColA = LTrim(RTrim("a")) & LTrim(RTrim(Str(i)))
doesnt change so it always goes into A1.

If anyone knows how to read data off a random acess file and put it into an excell sheet PLEASE tell me how.
Also if you dont get what im trying to ask tell me.

Right Align Cells Data In Excell Sheet Using Vb
I have an MS-Excell Sheet. It has columns and rows populated with data.
I am looking for vb code so that i open the Excell sheet from the vb s/w and when i press a button, all cell data gets right aligned.

Although it cab be done through Excell s/w options. How i can i do this freom vb code.

Please guide.

Populating Data From Datagrid 6.0 To Excell Sheet
populating data from datagrid 6.0 to excell sheet ...?

Save/ Open Data From MSHFlexGrid To Excell With VB6
hi there......

Does anybody knows how to save/open mshflexgrid data into/from an excell file ?

thanks

Fetching Data From A Web-page Into An Excell Cell
How can I fetch data from a certain web-page into an Excel cell?

Let's say the web page looks like this:
...
Manchester United 12 7 3 2 14:5 25
Bolton Wanderers 12 2 6 4 11:16 12
...

How can I fetch for example Manchester United's number of goals (14) into the Excel cell using e.g. VBA?

Any hints? Solutions?

Exporting Data From Grid Control To Excell
Hello Gurus,

I have a small problem.

I am using a grid control in my vb project. Which has 5 columns and
some rows. Now I would like to insert these values from the grid
into a new microsoft excell sheet from vb by clicking a button.
The columns and rows should come as it is there in the grid.

I would like to have the code for this problem.

Can anybody help me...?

Thank you

Regards

Benny

Get Data Out Of Sequential Text File In VBA (to Import In Excell)
Hey,

A teacher of us gave us this nice assignment. He wants us to automate an excell file. The user should open excell, give up a textfile, VBA should get certain data out of this textfile and import it into excell.

My VBA knowledge is rather limited. So i tried to open the text file with a textbox + a command button and the folowing code

VBA
Dim filename as string
Dim location as string
Dim freechannel as integer

filename = txtbestand.Text

If filename = 0 Then
MsgBox "There was no file selected."
Else
location = app.Path & "filename"
If Dir$(location) = " " Then
MsgBox "The file was not found. Please try again '"
Else
freechannel = FreeFile
Open location For Input As #freechannel
VBA

I get an error that the variable is not defined at app.path. What is wrong ? Is there an easier way to import data out of a sequential text file into vba ? Please explain it easily. I'm also in a bit of a rush, because i have to hand in the assignment on thuesday !

Thanks a lot !

Excell Type Data Entry Screen Using Visual Basic 6
hi all
i need a controll by using that i may able to make data entry
screen like excell entry .in wchich i can handel col level dataentry

VB And Excell W/out Having Excell Loaded
Can I use a program that retreives data from an Excel speadsheet on a machine that does not have Excel loaded?

Also, when I went to the references to set "Microsoft Excel 10.0 Object Library", it was not listed. Any ideas as to why it was not listed?

Any help or suggestions would be grealty appreciated.

Excell In VB 6
hey i am writing a program where i need to display an excell sheet and user form at the same time. the users make selections on the form with clicks. the info needs to be sent to particular cells on the sheet. i am using MDI with 2 forms one for the selections one for the sheet. i tried using the excell control but i can't seem to reference particular cells on the control. am i going about this the wrong way? there has to be a better way. i am a student so be easy.

Excell & VBA Help Please
Hello,

Please help. What I am trying to do, is grabbing a drawing name in Cells(x,2), automatically search the last modify date in C drive, and post the date in Cells(x,3). The current code works fantastic for me (Thanks for the helps from people in this forum), and currently I am just wondering for more options.

QUESTIONS:
1. Is there any way to automote searching my drawing file without having to list all my strPath? So i can just write the location is in "C:drawing able"
or this is even better if i can just list "C:drawing"
Can i apply this?

With Application.FileSearch
.NewSearch
.LookIn = "C:drawing able"
.SearchSubFolders = True
.FileName = "Run"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
End With

2. Is there any way to put a browse button, so if it is not the right path, then i can browse & locate a new path location and enter it into the inputox
3. Because my folder locations for current & future drawings are in a separate folder, but still in the same sheet, i have to split up the code to
run from x=1 to 20 for CURRENT drawing & from x = 21 to 55 for FUTURE drawing)
Everytime i add more drawing files into the current or future drawing, i have to modify the x value and change the range. For a lot of updates, this is painfull'
Is there any VBA code that can distinguish current & future drawing. So when it scans cells (x,1) and finds a "FUTURE" word, it knows
that it's time to run the code from a different folder & popup the MsgBox.

Thank you for everybody who had been helping me before. I really appreciate your help.

ps: The questions above are also posted inside the code.


Excell File

1 2 3
A Status Name Last Updated
B CURRENT drawing1 11/12/2001
C drawing2 12/06/2001
D drawing3 30/03/2001
.
.
T FUTURE drawinga 12/04/2002
U drawingb 14/08/2002



CODE:


Private Sub Workbook_Open()

Dim strX As String
Dim strF As String
Dim strPath As String
Dim strFile As String
Dim oFile As Object
Dim FSO As Object
Dim intSheetIndex As Integer



'--------CURRENT-------------

strPath = "C:drawing ablecurrentmodel_A"
strExt = ".dwg"


'''QUESTION 1 ''''''''
' Is there any way to automote searching my drawing file without having to list all my strPath? So i can just write the location is in "C:drawing able"
' or this is even better if i can just list "C:drawing"
' Can i apply this?
'
'With Application.FileSearch
' .NewSearch
' .LookIn = "C:drawing able"
' .SearchSubFolders = True
' .FileName = "Run"
' .MatchTextExactly = True
' .FileType = msoFileTypeAllFiles
'End With
'
'
''''''''''''''''''''''



Set FSO = CreateObject("Scripting.FileSystemObject")

If MsgBox("Is the folder location of " & strPath & " the correct path?", vbYesNo, "Confirm Path") = vbNo Then
strPath = InputBox("Please enter a new path bellow:", "New Path", strPath)
End If

'''QUESTION 2 ''''''''
' Is there any way to put a browse button, so if it is not the right path, then i can browse & locate a new path location and enter it into the inputox?
'
''''''''''''''''''''''

If FSO.FolderExists(strPath) = False Then
MsgBox "Invalid path (" & strPath & ")" & vbCrLf & "Macro cancelled!", , ""
Exit Sub
End If

intSheetIndex = 1

' ********

For x = 1 To 20

' ********

With Application.Sheets(intSheetIndex)
strF = .Cells(x, 2) & ".dwg"

If Len(strF) > 7 Then
strX = Mid(strF, Len(strF) - 3, 4)

If strX = strExt Then
strFile = strPath & Trim(strF)
blnExists = FSO.FileExists(strFile)

If blnExists = True Then
Set oFile = FSO.GetFile(strFile)
.Cells(x, 3) = oFile.DateLastModified
.Cells(x, 3).Font.Color = vbBlue

Else
.Cells(x, 3) = "File Not Found"
.Cells(x, 3).Font.Color = vbRed

End If
End If
End If
End With
Next
Set FSO = Nothing

End Sub



'----- FUTURE -----------



strPath = "C:drawing ablefuturemodel_B"
strExt = ".dwg"



strExt = ".dwg"
Set FSO = CreateObject("Scripting.FileSystemObject")
If MsgBox("Is the folder location of " & strPath & " the correct path?", vbYesNo, "Confirm Path") = vbNo Then
strPath = InputBox("Please enter a new path bellow:", "New Path", strPath)
End If
If FSO.FolderExists(strPath) = False Then
MsgBox "Invalid path (" & strPath & ")" & vbCrLf & "Macro cancelled!", , ""
Exit Sub
End If
intSheetIndex = 1

' ********

For x = 21 to 55

' ********

With Application.Sheets(intSheetIndex)
strF = .Cells(x, 2) & ".dwg"
If Len(strF) > 7 Then
strX = Mid(strF, Len(strF) - 3, 4)
If strX = strExt Then
strFile = strPath & Trim(strF)
blnExists = FSO.FileExists(strFile)
If blnExists = True Then
Set oFile = FSO.GetFile(strFile)
.Cells(x, 3) = oFile.DateLastModified
.Cells(x, 3).Font.Color = vbBlue
Else
.Cells(x, 3) = "File Not Found"
.Cells(x, 3).Font.Color = vbRed
End If
End If
End If
End With
Next
Set FSO = Nothing
End Sub



''' QUESTION 3 '''''
'
' Because my folder locations for current & future drawings are in a separate folder, but still in the same sheet, i have to split up the code to
' run from x=1 to 20 for CURRENT drawing & from x = 21 to 55 for FUTURE drawing)
' Everytime i add more drawing files into the current or future drawing, i have to modify the x value and change the range. For a lot of updates, this is painfull'
' Is there any VBA code that can distinguish current & future drawing. So when it scans cells (x,1) and finds a "FUTURE" word, it knows
that it's time to run the code from a different folder & popup the MsgBox.

Thank you for everybody who had been helping me before. I really appreciate your help.

Again Help; VBA Excell
Hello Guys,

Please help out. What I've been trying to do is getting the drawing file in my local C drive (Cells(x,1) or D1, E1, F1,..M1), retrive the date, and then automatically post the date on the next cell (Cells(x,2) or D2, E2, ...M2)

------------------------------------------
Excell File:

1 2
A Drawing File Last Updated
B
C Table
D drawing1 12/12/2001
E drawing2 12/12/2001
F drawing3 12/12/2001
G
H Chair
I drawing4 12/14/2001
J drawing5 12/15/2001
K
L Other
M drawing6 12/18/2001

---------------------------------------------
Current Code:

Sub ShowFileInfo()

Dim fs As Object, f As Object
Dim x As Integer, FileName As String

For x = 4 To 6
FileName = "C:drawing able" & Cells(x, 1).Text & ".dwg"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileName)
Cells(x, 2) = f.DateLastModified
Next x

For x = 9 To 10
FileName = "C:drawingchair" & Cells(x, 1).Text & ".dwg"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileName)
Cells(x, 2) = f.DateLastModified
Next x

For x = 13
FileName = "C:drawingother" & Cells(x, 1).Text & ".dwg"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(FileName)
Cells(x, 2) = f.DateLastModified

End Sub

--------------------------
Condition:

- Every drawing file (drawing1, drawing2, ..., drawing6 is hyperlinked to an internal website)

--------------------------
Right now i have to specify a location of x for each file as you can see in my code. If it scans a blank cell, it will return an error message. For a lot of drawings, this is painfull. =)

Priority 1:
is there any way to scan automatically ALL Cells(x,1) (including the blank one and the title) to get ONLY the hyperlinked file and then post the result on Cells(x,2)?
Priority 2:
How about if i change the name format of my drawing file in excell by adding .dwg file extension (drawing1.dwg, drawing2.dwg, ...drawing6.dwg) so that the computer can just scan only this file and skip blank or non .dwg extension?

Please help. Thank you

Excell & VBA Help Please
Hello

I have a lot of drawing files, which are stored in my local C drive. Currently, I use excell to list the name of the drawing files' from A1:A50 spreadsheet rows . From B1:B50 rows, I put the date when the last time I save it (which can be found on the property of the drawing). The problem is i have to change the date in excell manually everytime i update/save the drawing. Is there any VB script that will automatically read the file name, find in the local drive, grab the last updated date, and put it on the excell? Please help. Thank you in advance for the help

Excell And Vb
Is it possible to save everything on a form (data in combo boxes) to an excell sheet and be able to load it and save it as a seperate file each time

Vb And Excell
i want to work from vb with excell as my DB!
is it possible?how can i use it?
can i make queris on it?
thnaks in advance
peleg

Using Excell
Can someone please post a simple working example of a VB program that takes an entered value and puts it into an excel file, and then saves the file. Also how to empty the contents of an array into a column and then save it.

I have found a few examples but have not been able to figure out how the code works, much thanks in advance.

~ Bryan J. Casler

Vb And Excell As A DB
i want to work from vb with excell as my DB!
is it possible?how can i use it?
can i make queris on it?
thnaks in advance
peleg

Regarding Ms Excell
hi,
I am accessing excel having some rows........i am storing value of each row in a array.......how can check whether last row is reached?

thanks and regards
vivek.s

Regarding MS Excell
hi,
i am using (oApp.Sheets(1).UsedRange.Count) / no of cols(in my old version before GURU gave me another solution)...........to find no of rows.....now i deleted 1 row in excel and re ran the program.......still it counts the same no. of rows as it initially did.......any way to rectify this?

Thanks
S.vivek

VB-Excell
I am woking with VB and Microsoft Excell. To work with Excell I have included Microsoft excell from reference.It is just updating some cells based on some conditions.It is working fine in stand alone machine.
My problem lies in networking scenario.
The problem is that our excell file is kept in a machine say server.Machine1 and Machine2 is accessing the server to update the excell database(Every 1 min interval) .When the time of updation by two machines are becoming the same,the server machine is getting hanged. I think some sort of locking is necessary so that other machine can't update that when one machine is accessing the excell database.Please give me some solutions.

Excell EOF
Hi,

I have to write an app that imports an excell spreadsheet into a database.

Does anybody know how I can test for EOF on an excell spreadsheet. At this stage I test for blank cells but this is not working for all scenarios.

Any help would REALLY be appreciated

Excell
hello,
i'm using a flexgrid to hold data. now i want to be able to export this to excel and able to import it back up.

can anyone point me in the right direction?

thanx

Excell With V.B
HI
I've a application that use with excell object
(Insertable objects - microsoft excell)
How can I add my own sub menu to the excell menu?
For example : between "View" and "Insert" I want to add
"Functions"
Thank you

Excell And Dao
Hi hope someone can help me, i need to write some values on a exsiting excell sheet how can i open it and write in a specific cell?? i have seen the examples for doing it on a new sheet but i cant find how to do it on an existing one, hope someone could help me thanx.

Using VB In Excell
Can anybody recommend a good book that will teach me how to use VB within microsoft excel?

Excell
I am using this code:
Set objChart = OLE1.object.ActiveChart

It's work on my computer but if I make a set up from this code and install it in a computer that does not have excell, I get
run time eror 91 .

what should I do ?

Excell
Any Tutorials on Reading / Writing To Excel Work Sheets?

Set Excell = Nothing?????
Hi, I am manupolating an excell spread**** in my program but at the end when I say set objexcell = nothing.. It doesn't do anyting.. I mean it doesn't close the object and next time that I want to run the sub it says that the workbook is in use. Anyway to force the object to close??? Thanks in advance

VB 5.0 And Excell
Can anyone suggest the best way in which I can save data be it from a text file, ado recordset, or whatever source to an Excel spreadsheet. Do I have to open an instance of a spreadsheet or a workbook ??? I'm confused. Any help greatly appreciated
Steve
VB Programmer
Steveflit@aol.com

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