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




Linking A Textbox In Visual Basic To An Excel Cell


Hello all

I have a text box on a userform that relates to certain years - e.g. 2003-04. Is it possible for this textbox in the form to be linked to a cell from an excel s/sheet - so that when a user changes the cell the user form box will change automatically?

Cheers




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Visual Basic 6 0 Linking With Excel Problem
Hi
I am doing a project to read the output of an instrument and store in excel sheet. prepare charts on the input data and show it in userform.
I have succesfully read the data thru mscomm1 and am able to show it in a text box.Problem lies here. i dont know how to store this data in excel sheet.
If i type in the formula bar of excel sheet cell =project1|form1!text1, and try to keyin some text in text box only part of the text is transferred. if i press enter in between data only prior to key press is transferred.

pls help me in this regard.

Returning A Cell Coordinate In Excel To Visual Basic
i want to find out how to return a cells coordinate to visual basic. i have wrote functions to find how many rows there are in a table in excel and how many columns there are in a table in excel.

Eg if my functions return the value 6,8. then i want to know how to let my program know that it means cell f8. i cant use the cell(6,8) function.

Highlighted Excel Cell To Visual Basic 6 Code
have been trying to control Excel 2002 from within Visual Basic 6. I am working in VB6 and not in excel's VBA. I have had a liittle success opening and writing contents
to a excel cells. Now I would like to get the contents of the highlighted cell and read it back into VB 6. I would also like to put a value back into the cell that is highlighted on
a excel sheet from a visual basic 6. Note I am writing code in VB6 and not in excel VBA.
Since I am a beginer at controling excel with VB6 I would like to know about other commands that control excel 2002 from VB6. I have looked at my object browser but
have little luck using object browser to figure out excel automation commands. Maybe I don't know how to use object browser. Maybe some knows a look good website
link that describes excel VB6 commands to control excel. I would also like to
control Office access with VB6. Has anyone found any good website info on that subject? Note I am writing code in VB6 not in VBA.
Maybe I am asking the wrong question in the wrong forum because I don't know what they call the process of controling Office 2002 excel, access from Visual Basic 6?
thank you,

Changing Cell Color In Excel 2003 ~ Visual Basic 6.3
Need a little more help. Trying to write code to change the cell color in Excel 2003
, via Visual Basic 6.3. I thought the following code would work:

Sheets("PriceSummary").Range("C6:C7").Colors.ColorIndex = "Light Green"

or maybe using the color index number

Sheets("PriceSummary").Range("C6:C7").Colors.ColorIndex = "35"

or

Sheets("PriceSummary").Range("C6:C7").Colors.ColorIndex = 35


but doesn't happen for me.

Appreciate the assistance in advance.

Dan

How To Insert A Note/comment In A Cell In Excel Using Visual Basic Codes
Hello friends,

Can you please help?

I like to insert a note/comment into a cell in Excel using VBA, but I just don't know how.

Thank you for any suggestion and help.

Hu

Linking To DLL's Created In Visual Studio From Visual Basic
Can anyone give me some usefull tips or links on how to link to routines writen in C++ from Visual Basic

I am aware of the

Declare Function CloseHandle Lib "testdll.dll" (ByVal hObject As Long) As Long

type notation, but I am curious on what I have to do with my DLL to allow this notation to work.

Any suggestions or links would be a great help, thanks!!!

Linking A C Program To Visual Basic??
Hi

Is there any way in which I can link a C program to a VB program.

e.g. I want to have a program where at the click of a button in on the VB form a C program will execute. Further when the C program terminates the control will revert back to the VB application.

Cheers!

Anit

Linking Database To Visual Basic
hi guys, this is my first post of hopefully not too many

i have to link my visual basic project to a database for a booking form project and i can't get it to save from the form into the database. I can make records from my database show up in the form but not save into the database please can someone supply me with some basic code for me to save it please. the button to click when i want to save is cmdsavebooking and the database table is called CustomerData.

the things i want to save into the database are as follows:

txtforename
txtsurname
txtaddress
txtphonenumber
txttitleoffunction
txtprice(1) / txtprice(0) (in a control array - either to be saved would be great thanks )
chkfeepaid
chkregularbooking

optextension - All three of these are options in same frame. if one is selected
optdiscount - the other wont be. i just need them in access as checkboxes.
optnodiscount - Just discount and extension need to be saved as Yes/No

txtdateselected
txttimeselected



Thanks in advance, i hope you can save me!

Bluebolt44

Linking A Query To Visual Basic 6.0 SP6
Good Morning,

I have a simple query in Microsoft Access and would like to know how to implement this query into Visual Basic. Ideally I would like to put it on a command button. I tried manually putting the SELECT…FROM…ORDER BY code into Visual Basic but it does not understand the syntax.

Here is the query:

SELECT Customer_Orders.CustomerDateOfOrder, Customer_Orders.CustomerForename, Customer_Orders.CustomerSurname
FROM Customer_Orders
ORDER BY Customer_Orders.CustomerDateOfOrder;

I would appreciate any feedback.

Linking Tally To Visual Basic
Hi,
Can we link tally to Visual Basic. Is there any control to have a link with tally? can we post the receipts and payments to tally through vb code?

regards
Hiran

Visual Basic 6 Linking With PowerPoint
Hi, i'm expereinceing problems trying to open up a powerpoint presentation with my vb program. I've made a combo box and a command button such that the program will read its value when clicked upon.It then runs a sub program to retrieve the powerpoint. Currently, the presentation did pop up, but only in the minimized mode. Any ideas on how to get it running on the main screen? Or even better start the power point show.

Private Sub heat()

Dim oPPTApp As PowerPoint.Application
Dim oPPTPres As PowerPoint.Presentation
Dim sPresentationFile As String

sPresentationFile = "S.ppt"


Set oPPTApp = New PowerPoint.Application

oPPTApp.Visible = True


Set oPPTPres = oPPTApp.Presentations.Open(sPresentationFile)



End Sub

Linking EXSYS And Visual Basic
Hello everyone,
I am working on a school project. I need to put a front end on my EXSYS program. I was told the easiest way to do this is by using vb, but I do not know how to link the two programs together. If anyone could give me any advice or point me in the right direction, I would greatly appreciate it. Thanks.

PS EXSYS is simply a program that makes kbs' (knowlegde based systems). Thanks again.

Linking Global Variables To An Excel Cell
hi all
I declared some global variables in a Visual Basic project and wish to enter the value of those variables into a cell of a particular worksheet.
For example, I declared global variables, a and b. They hold the values, 5 and 10 respectively. In this sample, how can I enter a (5) into the cell A1 or b(10) into the cell B1 where let's say those cells are in a worksheet named "x" under the file "book.xls"
Thanks in advance
Looking forward to hearing from you

Linking Visual Basic With Either Access Or Excell
hi ,I was wondering if anyone could tell me how to link my visual basic program with either access or excell. Im hoping to be able to calculate a bill and then record it print it and provide reports if anyone could help I'd greatly appreciate any help.

Visual Basic 6 [Adding/Linking Boxes Together]
http://www.uploading.com/files/V2RQ8...Files.rar.html



Here are my files, baically i have made everything ok but i don't know much about the coding... where the boxes are i would like to put numbers in them (there are 12) and then the box near the bottom would then be linked to those 12 boxes so then it finds the total amount.

and the next box under "total" would then subtract/add the total amount and then display it in the box.

i'm a complete newb at VB and i was wondering if anyone could help me (your my last chance)

i would be very very happy if someone could make me the code so then i can use it in my boxes, i only require this as this is the problem i'm having (i'm in a IT Course ATM learning in college about this).

Linking C++ COFF OBJ Files In Visual Basic
Hey everyone, I've been recently struggling to find a solution to this problem.

Does anyone know if its possible to link a previously compiled C++ OBJ file along with Visual Basic OBJ files to produce an executable capable of utilizing procedures designed in C++?

I'm afraid I can't use a DLL, as the project must be stand-alone. However, would it be possible to configure the C++ functions defined within the OBJ file to be exported, so they could be called as regular APIs? Surely they'd have to be called dynamically with LoadLibrary and GetProcAddr, but that would hardly be an issue.

Any help and thoughts regarding this matter would be deeply appreciated.

From Excel Cell To VB TextBox
Hi,
How does one go about displaying the contents of a cell from an Excel spreadsheet in a VB TextBox ?

Ken

Basic Question About Excel Macros And Visual Basic
I have a macro in Excel that takes some input on data ranges and produces charts based on the input. I want to place those charts (a number of them are generated) at a certain point in my excel worksheet. I know I can nudge it over by a certain amount but I can never tell where Excel will place them so I would like to just say "hey chart, sit here". Being able to do that in relation to cells would be great. Also, I would like to know if there is any way to resize the chart without using the percent. Once again, in realtion to cells would be great. Thanks for your help.

Export A Excel Cell To VB Textbox
I can get it to the point where it calls the specified sheet and cell, but only to go to a message box.

I tried to do

txtSales.Text = objExcelws.Cells(5, "C")

but it didnt work.

However

MsgBox objExcelws.Cells(5, "C")

Does work.

Can someone help me fix this problem

Recall Cell Value In Excel Into Textbox.
This may seem basic but I'm stuck!

I have an applet with a textbox and a button called update.
When you type in the textbox and click update, it puts the value typed in the textbox in nominated cell in Excel.
When I recall the applet the textbox is empty and when you click update it obviously clears the cell.

What I want to happen is for the textbox to show the value in the cell when i recall the applet.

Add Textbox To A Worksheet From Visual Basic
Hi,
I'm making a VB application who create Excel file. But the problem is when I try to add a textbox, i always get error.

This is my line code:
Set MySheets = ActiveWorkbook.Worksheets(1)
MySheets.Shapes.AddTextbox(msoTextOrientationHorizontal, _
100, 100, 100, 100).TextFrame.Characters.Text = "test"

This work fine when I'm in the visual basic editor in Excel, but when I am in visual Basic 6, i'm getting this error:

Application-defined or object-defined error

Does anybody know how can I solve this problem?
I really need help

Thanks in advance

Print Textbox In Visual Basic
Dear All
I have a problem in printing some components in a form. In my suitation, I placed some textbox in a form. Now I want to print them in visual basic, What can I do? Would you like to give me some hints, thanks
Terry

Ho Do I To Add Days With Textbox In Visual Basic 6
Please help Me Again..

i have 3 text box control :
text1.text = start date
text2.text = constanta value (Days Interval, for example 300 days)
text2.tex = next date

How method (view code) to find next date (in text3.tex ) if i put 300 in text2.text..

Please help me again...i'm a beginner wish ur help....

Thanks so much........

How To Make A Textbox Reference A Cell In Excel
Hello all.

I'm writing a VB application that generates Excel workbooks. I'd like to have my program put a textbox into a chart that references a cell in worksheet in the same workbook.

I've figured out how to make a textbox in the chart:

Chart.Shapes.AddTextbox(msoTextOrientationHorizonta l, 0, 0, 100, 25).TextFrame.Characters.Text = "This is a TextBox!"

But I'd like to have that textbox reference cell B2 on Sheet1, so that whatever value is in Sheet1!B2 will show up in the textbox.

Thanks in advance to whomever can help me out!

-Dan

Visual Basic Get Text Of Another Window's TextBox
Good day to all of you VB gurus!

I would like to requests some help on how to create a VB6 code which will show me how to capture text from the EasyGPRS (Samsung) program. Within that program, SMS messages from a cellphone will be displayed their. I would like to get the actual message from the SMS window like shown below.



Basically, the word/string "Pau" must be obtained from the window then transferred to a text file (*.txt) so we can be able to apply it to our program.

Hope someone can help me on how I can do that.

Thanks!

Is It Possible To Pass Variables From A Textbox In Visual Basic?
is it possible to pass variables from a textbox in visual basic?

i am trying to pass a variable from a textbox. eg this is what is contained in a textbox


Hallo " & !Name & ", your current balance is " & !amount & ". please pay this amount to avoid disconnection!!! Customer Service.

the variables contained in the text box are !name and !amount

the app should be able to tell me what is contained in the field amount and name.

Running MS Excel 2000 Visual Basic In MS Excel 2002
Hi there this is my first post to the forum. I've looked all over Microsoft's website and Google but cannot find an answer to the following problem:

I have been working on a MS Excel spreadsheet that contains a number of macros and User Forms and two custom toolbars. I am working with MS Excel 2000 on a MS Windows 2000 desktop and am based in the United Kingdom. I emailed the finished spreadsheet to my colleague. She is using MS Excel 2002 on a MS Windows 2000 desktop and she is based in Montreal.

When she tried to run the spreadsheet it generated errors every time it tried to run any of the macros. The error was as follows: "Microsoft Visual Basic: Unexpected error (336) in Visual basic." Selecting help brought up further information: "Activex component not correctly registered: Error 336".

I have reported this to my company's IT support but as of yet they are not being that helpful (Visual Basic and Excel are not their strong points).

My colleague has checked to ensure that ActiveX is activated on her desktop but this has not resolved the problem.

Does anyone have any ideas what might be up here? Is it something to do with some kind of incompatibility between Excel 2000 and Excel 2002?

Any help would be greatly appreciated.

Thanks

Jack

Rich Textbox Formatting [Visual Basic Version: 6.0]
Hello! Dear all Friends...!
I'm using Microsoft Visual Basic 6.0. I'm making my first application for the document (both rich text formatted and plain text formatted) editing.

I've added too much tricks in my application e.g. Multiple Undo, Redo. Bullets as well as Numbering, Hyperlinking, Print Preview, Webpage Preview and many more... But I've some questions about Rich Textbox formatting. These are given below:

Q. 1. Is it possible to DROP CAP in Rich Textbox just like in Microsoft Office Word? Drop Cap is a feature which creates a large dropped initial capital letter of a specified paragraph. You can see this feature in Office Word.

Q. 2. How can we change the color of a Hyperlink in Rich Textbox without changing it by using custom ways e.g. SelForeColor property? (Changing the Default Blue Color of a Hyperlink to some one else)?

Q. 3. Is is possible to insert Mathematic Symbols e.g. Under roots, Squared, Greater or Lesser than, Integration, Derivation or else in Rich Textbox?

Q. 4 . In a table of Rich Textbox (table made by custom means in rich textbox), is it possible to sort it alphabetically?

Q. 5. How can I insert a line and a Break in a Rich Textbox?

Q. 6. Is it possible in Rich Textbox to add RTF Bookmarks in it?

Q. 7. How can we convert RTF code to HTML code?

Q. 8. Can we change the background of Rich Textbox? Not only the BackColor of Rich TextBox, to insert or set the Background Bitmap in Rich Textbox?

Please tell the answer to my questions. I'll be very thankful to you all, for this act of kindness!!!

Mr. Nakaam!

How To Get A Value From A Screen To Be Input Automatically In A Textbox From Visual Basic?
How to get a value from a screen to be input automatically in a textbox from Visual basic? ...?

Reading Text From A Webpage And Inserting It Into A Textbox In A Visual Basic App?
Hello, I was wondering if it was possible to read text from an internet webpage and insert it into a textbox on a Visual Basic application?

Cheers,
Blue Magic.

Visual Basic 6 TextBox To >> PHP Page Echoing The Form Data.
Okay, basically I'm trying to get a PHP page to display Textbox data entered from my program.

I got "test.com/test.php", and a program with a TextBox (Username), and a Connect button, when the user presses "Connect" I want a webpage(WebBrowser1) to open and display "Welcome Username1!" aka (<?php echo $GET_['Username'] ?>).

How would I go about doing this?

Thanks in advance.

Display Checkbox Value From MS Access To A Textbox In Visual Basic 6 Form
hello everybody,
im new here...
i wanted to ask this: how do i display checkbox value from my database MS access to a textbox in a visual basic 6 form? it has been displayed "True" or "False" but i want it to display "Active" for true value and "Not Active" for false value.
And,
i want to send value from my option buttons, optionActive and optionNotActive. if optionActive is true, then the value sent to ms access is also true (where it checks my checkbox) and vice versa.
im sorry if the questios are not clear enough. if there's any doubt regarding my questions, feel free to ask me back. :)
thank you very much for assisting me.

Finding A Cell Containing A Text String Input From A Textbox In An Excel Worksheet
Hello, i'm a new member to this forum and am using vb to create a userform to input job data for a lab.

i would be very appreciative for help on this particular problem.

what is the syntax for searching for a cell containing a text string (which the user inputs via a userform text box) in the active excel worksheet, and selecting it?

Any help would be greatly appreciated.

Thanks again

Comparing Field Date With Textbox Visual Basic And Crystal Report
I need select in the crystal report the invoices that have a date equal to the textbox that the user introduces in the screen.
The user introduce the date in format ddmmyyyy
please help me.

CheckBoxs, RadioButtons And TextBox Values Assigned To SINGLE Cell Of Excel Sheet.
Dear all,
I am having a form which is having 5 CheckBoxs, 4 RadioButtons and One TextBox which are defined to print values in only ONE cell.
Here is the code ..

If Form4.CheckBox1.Checked = True Then
.Range("n" & Count1).Value = "A"
End If

If Form4.CheckBox2.Checked = True Then
.Range("n" & Count1).Value = "B"
End If

If Form4.CheckBox1.Checked & Form4.CheckBox2.Checked & Form4.RadioButton1.Checked = True & True & True Then
.Range("n" & Count1).Value = "A, B & Bronze Coated"
End If


Like this I have to type several combinations , for example Randomly ...

ChBox1
ChBox1 & ChBox2
CHBox1 & ChBox3
ChBox1 & ChBox4 & RadioButton4
ChBox2 & ChBox3 & RadioButton4
ChBox5 & ChBox4 & RadioButton1

( OR )

TextBox1 ( Because it is User Defined Value )

**************************************************

Is there any way to assign all these values to ONE cell and that to applying some Great LOGIC.

could anybody plz help me.

Thanks in Advance.

Alen.

Visual Basic And Excel
Hello,

I have recently encountered a problem with populating an excel spreadsheet with VB6. I can load the data into Excel from a SQL Server 2000 machine without any problems through the VB code. But the sad thing is that now I need to format the data in excel. The reason being there are a lot of columns and they go off the paper when you are trying to print it.

Couple of questions:

1. Can you change the page setup of an Excel app through VB?
i.e., orientation, margins, etc...

2. Change the font of the rows in Excel?

2. Are there any other alternatives?

Thanks and appreciate all your help

Raj

Visual Basic And Excel
Hello, i want to do some formatting on a excel report created using visual basic, i want to be able to make the headings bold, the headings centered, and change the font of the report, does anyone know how to do this from visual basic.

Here is a sample of how the excel file is created

Public Function dofil(Optional typestr As String)


Const vbNormal = 1 ' window style
Dim opath


On Error Resume Next 'Ignore errors

Set objxl = GetObject(, "Excel.Application") 'look for a running copy of Excel
If Err.Number <> 0 Then 'If Excel is not running then
Set objxl = CreateObject("Excel.Application") 'run it
'ExcelWasNotRunning = True
Else
objxl.Close
Set objxl = CreateObject("Excel.Application") 'run it
End If
Err.Clear ' Clear Err object in case error occurred.

On Error GoTo 0 'Resume normal error processing


' set the Excel window properties (not absolutely necessary)
objxl.WindowState = vbNormal ' Normal
objxl.Height = 300 ' height
objxl.Width = 300 ' width
objxl.Left = 40 ' X-Position
objxl.Top = 20 ' Y-Position
objxl.Visible = False ' show window

Set objWb = objxl.Workbooks.Open(App.Path & "jei_report.xls") 'open file dialog box
checkfirst = 1

If (loopcheck = 1) Then

End If
' Get the first loaded worksheet object of the current workbook
Set objWb = objxl.ActiveWorkbook.Worksheets(1)
'MsgBox ("worksheets object initialised")
objWb.Activate ' not absolutely necessary (for CSV)

opath = App.Path & "jei_report"

Set objTab = objWb.QueryTables.Add("TEXT;" & opath, objWb.Range("A1"))


objTab.Name = "Names"
objTab.FieldNames = True
objTab.RowNumbers = False
objTab.FillAdjacentFormulas = False
objTab.PreserveFormatting = True
objTab.RefreshOnFileOpen = False
objTab.RefreshStyle = 1 'xlInsertDeleteCells
objTab.SavePassword = False
objTab.SaveData = True
objTab.AdjustColumnWidth = True
objTab.RefreshPeriod = 0
objTab.TextFilePromptOnRefresh = False
objTab.TextFilePlatform = 2 'xlWindows
objTab.TextFileStartRow = 1
objTab.TextFileParseType = 1 'xlDelimited
objTab.TextFileTextQualifier = -4142 ' xlTextQualifierNone
objTab.TextFileConsecutiveDelimiter = True
objTab.TextFileTabDelimiter = False ' ### delimiters
objTab.TextFileSemicolonDelimiter = True
objTab.TextFileCommaDelimiter = False
objTab.TextFileSpaceDelimiter = False
objTab.TextFileColumnDataTypes = Array(1, 1)
objTab.Refresh True


objxl.DisplayAlerts = False ' prevent all message boxes

objWb.Columns("A:AY").EntireColumn.AutoFit
objxl.Columns("A:AY").EntireColumn.AutoFit


savepath = App.Path & "
eportsJEI_REPORT-" & Format(mskdate.Text, "ddmmyyyy") & "-" & Format(mskEndDate.Text, "ddmmyyyy") & ".xls"
Call MsgBox("Report Generated Succesfully", vbOKOnly, "JEI Daily Report")
MousePointer = vbArrow

objWb.SaveAs savepath
objxl.Quit ' Quit Excel
Set objxl = Nothing

StatusBar1.Panels(2).Text = " Report Generated Successfully"

End Function

EXCEL To Visual Basic !
Hi all together! Ok, ill roll it up fast:

I have to code an application which manages the printing of data out of an excel sheet - in special ways and with some extras making it possible to stop and pause the printer and stuff like that.

What i need now, is to know, what the best way is, to load an excel sheet into Visual Basic. I tried common FlexGrid control stuff in combination with the Excel 9.0 Object Library. It did work but it does work too slow.

I have an example usage .xls-file from the company who wants the program and it has (!!!) over 3500 rows and 11 columns, which makes a loading time of 12 centuries.

So please, people from around this planet, if you can - help me - and i will help you when needed - if i can.

Thanks & kindest regards.

Cheers, Leo

Visual Basic &amp; Excel
I would like to know if i can create an array of Excel Worksheets and write data into them from Visual Basic 6.0 .
If yes then i would like to know the steps that should be followed to do the same.

OLE, Excel, Visual Basic...
My app runs, does the excel stuff, but when I try to quit Excel, it causes Excel to Crash. heres the code:



Code:

Dim obj As Object

frmCustomView.OLE1.CreateEmbed "F:MasterExported.xls", "Excel.Sheet"
Set obj = frmCustomView.OLE1.object

frmCustomView.ccrpProgressBar1.Increase 10

'On Error GoTo ErrSub

'With obj
obj.Application.Visible = True

'If the file already exists, open it. Otherwise error out.
If fileExists("F:MasterExported.xls") Then
obj.Application.Workbooks.Open "F:MasterExported.xls", , False
Else
MsgBox "Error:", vbOKOnly, "Database not exported!"
GoTo ExitMe
End If

'Setup the Master Dababase to display right
If Not ExportAll Then obj.Application.Range("A1") = "Complex Name"

obj.Application.Range("B2").Select
obj.Sheets("Master").PageSetup.PrintTitleColumns = "$A:$A"
obj.Sheets("Master").PageSetup.PrintTitleRows = "$1:$1"
obj.Windows(1).FreezePanes = True
obj.Application.Range("$1:$1").RowHeight = "45.00"
obj.Application.Range("$1:$1").Font.Bold = True
obj.Application.Range("Master").Select
obj.Application.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
obj.Application.Selection.Borders(xlDiagonalUp).LineStyle = xlNone

'Set all the borders in the master database to thin lines
'obj.Worksheets(1).Activate
obj.Application.Range("Master").Select
For i = 7 To 12
With obj.Application.Selection.Borders(i)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next i

'Change the color of the first row
obj.Application.Range("$1:$1").Interior.ColorIndex = 15

'Make the columns as wide as the widest cell in the column
obj.Application.Columns.AutoFit
obj.Application.Range("A1").Select

'Close the workbooks and Quit Excel
'obj.Application.Interactive = False
'obj.Application.Workbooks("Exported.xls").Save
obj.Application.Workbooks("Exported.xls").Close True
'obj.Application.Quit
Set obj = Nothing
frmCustomView.OLE1.Delete
It causes Excel to crash at the end, at "obj.Application.Quit".

Any Ideas?

Excel Visual Basic
I am developing a program for certain types of users and I want the program to start running as soon as the file is opened. I have tried, however, I feel that I am getting close.

I would also like to know how to prompt the user the enter a "Save as..." file name and have that name be used to save the file with the click of a command button.

I am using Excel 97. It would be wise to just cut and paste any sample that you may have. Sending files may or may not be permitted within the BGE IT Security Range. Please respond as soon as your time is available, thank you.

Using Excel By Visual Basic
Hello,

I got a question about the use of Visual Basic at Excel.
I want a program (or script) made with Visual Basic (i think this is the best way to do it), which does the following:
Select an excelfile (using a pop-up screen), a startdate and enddate (and puts this start- and enddate in the just selected excelfile). Excel calculates using the new dates,l like excel always does when data is refreshed. Than the program must save the "new" file using the filename plus the date (for example: comp.xls is one of the files you can pick in the pop-up screen, and the file will be saved as: comp060702_070702.xls) and then prints the file.

Can anyone help me with this?

Visual Basic And Excel.
Hello there, it is my first post here (*'-'),

and I 'll already begin to break your balls xD. In fact, for work I have to develop an application handling excel files. No troubles I manage. However at a point I have to check all fields from a column with all possible possibilities, which are in another excel file (and later add them if necessary).

Ok, simple.. double loop and that's it. However the process is extremely slow. Ok I have 1700+ thing to check 100 times lol, but is there another way to make it smoother? (my personal opinion is no, but I really want to make it sure).

Here is my code:


'Check brand
Set eWorkSheet1 = exl.Worksheets(2)

If Form2.Check1 = "1" Then
'Sales

i = 2
a = a + 5
While eWorkSheet.Cells(i, 5) <> "" 'cell of the first sheet i have to cjeck
u = False
b = 2

While eWorkSheet1.Cells(b, 1) <> "" And u = False

If eWorkSheet.Cells(i, 5) = eWorkSheet1.Cells(b, 1) Then 'cheking with the other workbook
u = True
End If

b = b + 1
Wend


If u = False Then

If eWorkSheet.Cells(i, 6) > 2000 Then 'oh yeah in case its a new brand i took note of it only if we sell a lot from it

eWorkSheet2.Cells(a, 1) = "The brand " & eWorkSheet.Cells(i, 5) & " for " & eWorkSheet.Cells(i, 6) & " pieces is not known; please check it on row " & i & "." 'then I write what to check in another file
a = a + 1

End If

End If



i = i + 1
Wend

End If
Print "Brands checked"

As you can see, it is the most simple way to do it which I was taught like my second week I was in school, but could we do faster?

New To Visual Basic, Need Help For Excel
Hello,

I am working at a company where we make glossaries by hand by taking a Word document that has roughly 500 words and deleting out the unnecessary terms. I would like to create a macro in Excel that will automatically pull the correct terms and then add on the definition to the end of the term so we don't have to spend 2 hours deleting out terms and praying we do not miss one.

I was thinking of making some sort of statement like:
If cell=mild, then change cell to = mild - definition

How would I put that into Visual Basic talk for Excel 2003?

Also, there are terms that are bolded that I need to delete out of the list. Is there something I can write in that says if cell is bold then delete it from the spreadsheet?

One last question, how do I exclude cells based on their formatting? I made a macro that will auto-run TRIM on a spreadsheet, but it will mess up cells formatted as time. How would I exclude these cells?

Thank you all a lot for any help you can provide. I wish there was an English to Visual Basic dictionary because I would love to learn about this program. I know what I need to do, I just lack the language to accomplish my goals.

Excel And Visual Basic Help
Hey, Im trying to have it so the information can be added to the list boxes accordingly, although excel is a different situation than plain visual basic....

I'd appreciate it if anyone could get my purchase list to work..

Thank you Kindly.

Since i cant attach excel files, here is a link http://www.lifesbattles.com/forum/files/book1_659.xls

Thanks.

Excel In Visual Basic
I am creating an excel report in Visual Basic. I want to get the average of some cells . so i should use the formula for cell
this is what i have written. the first one give me the sum of fields and the other one gives me the average of cells. but i should be careful about the count of cells.if it is 0 the value 0 should be returned else the average should be return
WS1.Cells(i, 33).Formula = "=sum(B5:AF5)"
WS1.Cells(i, 34).Formula = "=IF(COUNT(B5:AF5)>0;AVERAGE(B5:AF5);0)"

but it gives me the error. "Applicatio-defined or Object defined Error"
I am sure that this formula "=IF(COUNT(B5:AF5)>0;AVERAGE(B5:AF5);0)"
is correct because it gives the correct answer when i enter it to excell cell manually . but not by programming

any onen can help me?

Ms-excel To Visual Basic
I Want To Connect Ms-excel To The Visual Basic As Work As With Access Because I Have Been Using Ms Excel Before. I Tried With Ole But Not Satisfactory Result Was Seen. Can Anybody Help Me?

Visual Basic Excel Help Please
Hello,

I am new to visual basic and I guess that what I am asking can be a very easy thing to do but not for me.

I am trying to get the value of the cell of a closed workbook2.xls inside an activated workbook1. But I cannot do that unless workbook2 is also running (inactivated).

I want to get this value though without having to open workbook2. If thats impossible can I open workbook2 just by typing some code inside workbook1?

The command I am using at the moment is

Range("A1").Value = Workbooks("WorkBook2.xls").Worksheets("Sheet1").Range("A1").Value

I would really appreciate any ideas you offer me thank you very much...

Poseilus

Visual Basic In Excel
Hi

I'm really quite new to VB and have some code that is proving to be quite buggy so was hoping someone might be able to help.

In my job, I have to format reports on Internet use in the following format

A B
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:11
01/05/200709:03:12
01/05/200710:00:00
01/05/200710:00:00
01/05/200710:00:00
01/05/200710:00:01
02/05/200709:03:12
02/05/200709:03:14
02/05/200709:03:50
02/05/200709:03:51


Basically, I need my VB code to detect if there is a change in time > 00:03:00 (this needs to result in a insert row and delete all rows in between) or if the date column changes, again insert row needs to occur. In the above example, the code would be formatted to...

01/05/200709:03:11
01/05/200709:03:12

01/05/200710:00:00
01/05/200710:00:01

02/05/200709:03:12
02/05/200709:03:51

I hope I havent lost anyone well at the moment it works but appears to be buggy, rows inserted when not needed, rows not deleted when they should be. I was wondering if anyone can give me any piointers from the following code.

Many Thanks

Steven


Sub Brand()
Dim Date1 As Date
Dim Date2 As Date
Dim Date3 As Date

Application.Goto Range("B1")
Date1 = ActiveCell.Value & " " & Format(ActiveCell.Offset(0, 1).Value, "hh:mm:ss")
Date2 = ActiveCell.Offset(1, 0).Value & " " & Format(ActiveCell.Offset(1, 1).Value, "hh:mm:ss")
Date3 = ActiveCell.Offset(2, 0).Value & " " & Format(ActiveCell.Offset(2, 1).Value, "hh:mm:ss")

Do Until IsEmpty(ActiveCell.Offset(2, 0).Value)
Debug.Print DateDiff("n", Date2, Date3)

If DateDiff("d", Date1, Date2) > 0 Then
ActiveCell.Offset(1, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(1, 0).Select
Else
If DateDiff("s", Date1, Date2) <= 180 Then
If DateDiff("n", Date2, Date3) < 3 Then
ActiveCell.Offset(1, 0).EntireRow.Delete
Else
ActiveCell.Offset(2, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(1, 0).Select
End If
Else
If DateDiff("n", Date2, Date3) < 3 Then
ActiveCell.Offset(1, 0).EntireRow.Delete
Else
ActiveCell.Offset(2, 0).Select
ActiveCell.EntireRow.Insert
ActiveCell.Offset(1, 0).Select
End If
End If
End If

Date1 = ActiveCell.Value & " " & Format(ActiveCell.Offset(0, 1).Value, "hh:mm:ss")
Date2 = ActiveCell.Offset(1, 0).Value & " " & Format(ActiveCell.Offset(1, 1).Value, "hh:mm:ss")
Date3 = ActiveCell.Offset(2, 0).Value & " " & Format(ActiveCell.Offset(2, 1).Value, "hh:mm:ss")

Loop

End Sub

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