Search Results

Search found 1188 results on 48 pages for 'vba'.

Page 19/48 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Can I use RegFree Com with an application written in Excel VBA?

    - by Steven
    I have an application that is written in Excel VBA, myApp.xls. Currently we use InstallShield to distribute the application. Since we are moving to Windows Vista, I need to be able to install the application as a standard user. This does not allow for me to update the registry during the install process. In addition to the excel application we also have several VB6 applications. In order to install those applications, I was able to use RegFree com and Make My Manifest (MMM) as suggested by people on this forum (I greatly appreciate the insight btw!). This process, although a bit tedious, worked well. I then packaged the output from MMM in a VS '05 installer project and removed the UAC prompt on the msi using msiinfo.exe. Now I am faced with installing an application that basically lives in an Excel file. I modified a manifest that MMM created for me for one of my VB6 apps and tried to run the excel file through that, but I did not have much luck. Does anybody know of a way to do this? Does RegFree com work with VBA? Any thoughts or suggestions would be much appreciated. Thanks, Steve

    Read the article

  • How do I create a VBA macro that will copy data from an entry sheet, into a summary sheet by date

    - by Mukkman
    I'm trying to create a macro that will copy data from a data entry sheet into a summary sheet. The entry sheet is going to be cleared daily so I can't use a formula just to reference it. I want the user to be able to enter a date, run a macro, and have the macro copy the data from the entry sheet into the cells for the corresponding date on the summary sheet. I've looked around and found bits and pieces of how to do this but I can't put it all together. Update: Thanks to the information below I was able to find some additional data. I have a pretty crude macro that works if the user manually selects the correct cell. Now I just need to figure out how to automatically select the current cell relative to the current date. Sub Update_Deposits() ' ' Update_Deposits Macro ' Dim selectedDate As String Dim rangeFound As Range selectedDate = Sheets("Summary Sheet").Range("F3") Set rangeFound = Sheets("Deposits").Cells.Find(CDate(selectedDate)) Dim Total1 As Double Dim Total2 As Double Dim Total3 As Double Dim Total4 As Double Dim Total5 As Double Total1 = Sheets("Summary Sheet").Range("E6") Total2 = Sheets("Summary Sheet").Range("E7") Total3 = Sheets("Summary Sheet").Range("E8") Total4 = Sheets("Summary Sheet").Range("E9") Total5 = Sheets("Summary Sheet").Range("E10") If Not (rangeFound Is Nothing) Then rangeFound.Offset(0, 2) = Total1 rangeFound.Offset(0, 3) = Total2 rangeFound.Offset(0, 4) = Total3 rangeFound.Offset(0, 6) = Total4 rangeFound.Offset(0, 7) = Total5 End If ' End Sub This version will find the first value on the page and fill in values: Sub Update_Deposits() ' ' Update_Deposits Macro ' Dim selectedDate As String Dim rangeFound As Range selectedDate = Sheets("Summary Sheet").Range("F3") Set rangeFound = Sheets("Deposits").Cells.Find(CDate(selectedDate)) Dim Total1 As Double Dim Total2 As Double Dim Total3 As Double Dim Total4 As Double Dim Total5 As Double Total1 = Sheets("Summary Sheet").Range("E6") Total2 = Sheets("Summary Sheet").Range("E7") Total3 = Sheets("Summary Sheet").Range("E8") Total4 = Sheets("Summary Sheet").Range("E9") Total5 = Sheets("Summary Sheet").Range("E10") If Not (rangeFound Is Nothing) Then rangeFound.Offset(0, 2) = Total1 rangeFound.Offset(0, 3) = Total2 rangeFound.Offset(0, 4) = Total3 rangeFound.Offset(0, 6) = Total4 rangeFound.Offset(0, 7) = Total5 End If ' End Sub

    Read the article

  • Teaching OO to VBA developers [closed]

    - by Eugene
    I work with several developers that come from less object oriented background like (VB6, VBA) and are mostly self-taught. As part of moving away from those technologies we recently we started having weekly workshops to go over the features of C#.NET and OO practices and design principles. After a couple of weeks of basic introduction I noticed that they had a lot of problems implementing even basic code. For instance it took probably 15 minutes to implement a Stack.push() and a full hour to implement a simple Stack fully. These developers were trying to do things like passing top index as a parameter to the method, not creating an private array, using variables out of scope. But most of all not going through the "design (dia/mono)log" (I need something to do X, so maybe I'll make an array, or put it here). I am a little confused because they are smart people and are able to produce functional code in their traditional environments. I'm curious if anybody else has encountered a similar thing and if there are any particular resources, exercises, books, ideas that would be helpful in this circumstance.

    Read the article

  • Sorted list of file names in a folder in VBA?

    - by Karsten W.
    Is there a way to get a sorted list of file names of a folder in VBA? Up to now, I arrived at Dim fso As Object Dim objFolder As Object Dim objFileList As Object Dim vFile As Variant Dim sFolder As String sFolder = "C:\Docs" Set fso = CreateObject("Scripting.FileSystemObject") Set objFolder = fso.GetFolder(sFolder) Set objFileList = objFolder.Files For Each vFile In objFileList ' do something ' Next vFile but it is crucial to be sure the processing order of the for loop is determined by the file names... Any help appreciated!

    Read the article

  • Which is better practice: complex SQL statements or Recordset manipulation in Access VBA?

    - by mazi
    I'm doing some VBA development and I found creating SQLs quite efficient way of getting everything done (selecting and updating). But I got to this stage where my SQL statements contain complex Switches and WHERE conditions where I have another Selects to update appropriate records. Therefore, I create this SQLs and I simply run it via "CurrentDb.Execute strSQL" and it does everything fine. The question is, why would I declare ADODB.connections etc, set recordsets, loop through it and manipulate the data one by one?

    Read the article

  • Can I turn off inline syntax checking in the Office 2003 VBA editor?

    - by ChristianLinnell
    As anybody who uses VBA in Office 2003 will know, it has the extremely frustrating tendency to do a syntax check every time you click off a line. For example, if I start writing a line of code, I might go > For Each application In And then think "crap, what's the application collection called?" So I'll hit "page up" to find it, and get (in this case) a "Compile Error". Can I turn this off?

    Read the article

  • Using the RSSBus Salesforce Excel Add-In From Excel Macros (VBA)

    - by dataintegration
    The RSSBus Salesforce Excel Add-In makes it easy to retrieve and update data from Salesforce from within Microsoft Excel. In addition to the built-in wizards that make data manipulation possible without code, the full functionality of the RSSBus Excel Add-Ins is available programmatically with Excel Macros (VBA) and Excel Functions. This article shows how to write an Excel macro that can be used to perform bulk inserts into Salesforce. Although this article uses the Salesforce Excel Add-In as an example, the same process can be applied to any of the Excel Add-Ins available on our website. Step 1: Download and install the RSSBus Excel Add-In available on our website. Step 2: Open Excel and create place holder cells for the connection details that are needed from the macro. In this article, a spreadsheet will be created for batch inserts, and these cells will store the connection details, and will be used to report the job Id, the batch Id, and the batch status. Step 3: Switch to the Developer tab in Excel. Add a new button on the spreadsheet, and create a new macro associated with it. This macro will contain the code needed to insert a batch of rows into Salesforce. Step 4: Add a reference to the Excel Add-In by selecting Tools --> References --> RSSBus Excel Add-In. The macro functions of the Excel Add-In will be available once the reference has been added. The following code shows how to call a Stored Procedure. In this example, a job is created to insert Leads by calling the CreateJob stored procedure. CreateJob returns a jobId that can be used to upload a large number of Leads in one transaction. Note the use of cells B1, B2, B3, and B4 that were created in Step 2 to read the connection settings from the Excel SpreadSheet and to write out the status of the procedure. methodName = "CreateJob" module.SetProviderName ("Salesforce") nameArray = Array("ObjectName", "Action", "ConcurrencyMode") valueArray = Array("Lead", "insert", "Serial") user = Range("B1").value pass = Range("B2").value atoken = Range("B3").value If (Not user = "" And Not pass = "" And Not atoken = "") Then module.SetConnectionString ("User=" + user + ";Password=" + pass + ";Access Token=" + atoken + ";") If module.CallSP(methodName, nameArray, valueArray) Then Dim ColumnCount As Integer ColumnCount = module.GetColumnCount Dim idIndex As Integer For Count = 0 To ColumnCount - 1 Dim colName As String colName = module.GetColumnName(Count) If module.GetColumnName(Count) = "id" Then idIndex = Count End If Next While (Not module.EOF) Range("B4").value = module.GetValue(idIndex) module.MoveNext Wend Else MsgBox "The CreateJob query failed." End If Exit Sub Else MsgBox "Please specify the connection details." Exit Sub End If Error: MsgBox "ERROR: " & Err.Description Step 5: Add the code to your macro. If you use the code above, you can check the results at Salesforce.com. They can be seen at Administration Setup -> Monitoring -> Bulk Data Load Jobs. Download the attached sample file for a more complete demo. Distributing an Excel File With Macros An Excel file with macros is saved using the .xlms extension. The code for the macro remains in the Excel file, and you can distribute your Excel file to any machine where the RSSBus Salesforce Excel Add-In is already installed. Macro Sample File Please download the fully functional sample excel file that includes the code referenced here. You will also need the RSSBus Excel Add-In to make the connection. You can download a free trial here. Note: You may get an error message stating: "Can't find project or library." in Excel 2007, since this example is made using Excel 2010. To resolve this, navigate to Tools -> References and uncheck the "MISSING: RSSBus Excel Add-In", then scroll down and check the "RSSBus Excel Add-In" listed below it.

    Read the article

  • using Excel VBA, given the daily price of 50 stocks, choose 10 stocks such that they have the minumu

    - by correl
    The high-level goal is to choose 10 stocks that have the lowest correlation among one another, out of a pool of 50, so that I can have a well-diversified portfolio. I have managed to write some VBA macro to download the past 3 years of daily price data from Yahoo finance, and then compute the 50x50 correlation matrix (using the Correl function), using the daily close as the data. What I have tried so far is just some local-maximum heuristic: - For the two stocks that have the highest correlation with each other, remove one of them. Between the two, remove the one that has the higher average correlation with all the other stocks. - When I remove a stock from the pool, I just delete the correponding row and column, to give a smaller matrix. - Repeat until I have just 10 stocks remaining (a 10x10 matrix). I was wondering if there is some algorithm that already solves such a problem and gives the optimum solution?

    Read the article

  • How do I get the cell value from a formula in Excel using VBA?

    - by Simon
    I have a formula in a range of cells in a worksheet which evaluate to numerical values. How do I get the numerical values in VBA from a range passed into a function? Let's say the first 10 rows of column A in a worksheet contain rand() and I am passing that as an argument to my function... public Function X(data as Range) as double for c in data.Cells c.Value 'This is always Empty c.Value2 'This is always Empty c.Formula 'This contains RAND() next end Function I call the function from a cell... =X(a1:a10) How do I get at the cell value, e.g. 0.62933645? Excel 2003, VB6

    Read the article

  • Why is it not possible to call RegFree COM and .NET from the VB IDE (VB6 & VBA)?

    - by DangerMouse
    Hi I have an example project with works when called from compiled VB6 but not from the IDE or from Excel's VBE. There are 3 DLLs QA.DLL, QB.DLL, QAW.DLL. QA is written in C#.NET, QB and QAW are written in VB6. QAW is a COM wrapper of QA. In the calling code I create an Activation Context and load a manifest file. All works fine from the exe created with VB6, but not in debug mode in VB6 or in Excel's VBA. I have the full example in zip. Any ideas what it is that is different about the IDE call and why it doesn't work? Many Thx -- DM

    Read the article

  • Need to open to two excel files and add numbers from them into a third file using vba.

    - by Harpyar Singh
    I have two excel files which has similar formatting and the data map each other from cell b15:h31. Row 15 is heading and so is the column B. I want to read file1 cell by cell and add that cell's content to the corresponding cell in File 2 i.e C16 in file 1 gets added to C16 in file 2, C17 in file 1 to C17 in file 2 and so on. The output goes in file 3 or anything. trying to implement through vba but of no success so far. Does anyone know how to go about it.

    Read the article

  • It's easy to set a breakpoint when debugging VBA, but how about a "startpoint" or a "skippoint"?

    - by PowerUser
    I'm debugging a subroutine in my VBA code. I want to ignore the first half and just run the second half. So, is there a way to set a 'startpoint'? Also, is there an easy way to ignore a specific line of code other than commenting? If not, I'll just continue commenting out all the code I don't want run. The problem with this, of course, is that I have to remember to uncomment the critical code before I send it on to Production.

    Read the article

  • Word VBA: How to know if the actual save operation is completed?

    - by Edwin
    Hi, I am having a problem with the Document.SaveAs method in Word VBA with large Word documents, it seems that the save operation is asynchronous, ie. after calling SaveAs it returns immediately, but with large Word documents the actual save operation may not has been completed and it's in progress in another thread. So what I want to ask is that if there is a way to detect if the actual save operation is in progress or finished? PS. I use Delphi to call the automation interface of Word, if it means something in discussing this problem, but I don't' think so? Thank you in advance.

    Read the article

  • how do i set a value to a range using a function from module in excel vba?

    - by gadym
    hello all, i want to do a simple function in a module in excel vba, so i can use it as a custom function in excel. (i use excel 2003, or 2007 , it's doesnt matter) i create a function(!) in a new workbook and it's looks like this: Function a() Sheets(1).Range("A1").Value = 4 end function but when i try to use it on the sheet1 it's wont work! i tried many things. how can i make this work (with no workarounds, i want to use it as a custom function) ? please help. thanks, gadym

    Read the article

  • Migrating from VBA Excel 2003

    - by Krazy_Kaos
    I have a series of big excel files that work like a program, but I hate beeing tied up (stuck in VBA for excel 2003), so... Whats the best way to implement a gui over a excel vba program (office 2003)? (are there any tools for that... I want to move away from the office suite, but still have it in the background) Or what's the easiest alternative for migrating this code to a more open language. Any ideias?

    Read the article

  • Delete all rows that do not have the value: Criteria 1 or Criteria 2 or Criteria 3 in Column D --> Using VBA Macro for excel

    - by JDS
    I am new to Macro's/VBA and cannot seem to figure out how to do this action for multiple criteria. I am trying to Delete all rows that do not have the value: Identify Fail or Identify Success in Column D. I write the following code and it works for one criteria "Identify Fail": '***********************************************' Sub DeleteRows() 'Action 1 --> Delete all Rows without Identify Fail in column D' Application.ScreenUpdating = False For i = Range("D" & Rows.Count).End(xlUp).Row To 1 Step -1 If Range("D" & i).Value <> "Identify Fail" Then Rows(i).Delete shift:=xlUp Next i Application.ScreenUpdating = True End Sub '***********************************************' Once I try to add 'OR' with another criteria it does not work: '***********************************************' Sub DeleteRows() 'Action 1 --> Delete all Rows without Identify Fail in column D' Application.ScreenUpdating = False For i = Range("D" & Rows.Count).End(xlUp).Row To 1 Step -1 If Range("D" & i).Value <> "Identify Fail" Or "Identify Success" Then Rows(i).Deleteshift:=xlUp Next i Application.ScreenUpdating = True End Sub '***********************************************' Any suggestions would be appreciated as I have been scouring this website and have not found an efficient code that will do the trick.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >