Search Results

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

Page 27/48 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Access: Data Type Mismatch using boolean function in query criteria

    - by BenV
    I have a VBA function IsValidEmail() that returns a boolean. I have a query that calls this function: Expr1: IsValidEmail([E-Mail]). When I run the query, it shows -1 for True and 0 for False. So far so good. Now I want to filter the query to only show invalid emails. I'm using the Query Designer, so I just add a value of 0 to the Criteria field. This gives me a "Data Type Mismatch" error. So does "0" (with quotes) and False. How am I supposed to specify criteria for a boolean function?

    Read the article

  • Pulling data from a text file to generate a report

    - by Edmond
    Have a program in Access, using VBA. I need to come up with an If statement to pull data from a text file. The data is a list of procedures and prices. I have to pull the prices from the text file to show in a report how much each procedure costs. ID PID M1 M2 M3 Total 1 11120390(procedure) 2 180(price) 360 180 540 1080(total Price) 3 2 1 3 6(Units sold) 4 5 200(Price) 200 600 800 1600(total price) 6 1 3 4 8(Units Sold) 7 11120390(procedure) The table in the text file is setup like this and I need to Pull the procedure number and the price of each procedure from the text file.

    Read the article

  • MS Access Force report footer to bottom of page

    - by LanguaFlash
    I am trying to make a report for a proposal. I would like to keep a professional look and always force the terms section to the bottom of the page. I could use the page footer but I only want the terms to show on the last page. My idea is somehow with VBA to set the height of a dummy group such that it forces the report footer to the bottom. The problem is that you can't explicitly set the height of a section. Anyone else out there with another idea (That works)? :-) Thanks, Jeff

    Read the article

  • Excel 2007 Visual Basic Editor: eats spaces, throws cursor around

    - by Vincent
    I can't resolve this issue, I found a similar question here but: setting the workbook to Manual calculation (alt-m-x-m or alt-t-oformulas) didn't work Setting editor options to disable: Auto syntax check & Background compile didn't work anybody have any idea how to fix this very annoying behaviour, I'm used to quickly pop up VBA (alt-f11), f7 to get into code and write some quick procedures there... and it's hard to get out of that habit, I don't want to write any office extension to just add a single quote to every cell in the range For Each rg In Selection rg = chr(39) & rg.value Next F5, done...

    Read the article

  • Centralised/shared COM DLL, possible?

    - by vikp
    Hi, We have a system that makes a use of 3rd party COM DLL written in vba We have a centralised web application and 1-50 client machines that must reference that COM DLL in order to use our centralised web application. The COM DLL is going to be updated rapidly in the future, which means that it has to be re-installed on every machine manually. Is it possible to centralise this COM DLL somwhere on the network? Is there any other alternatives? Otherwise the maintenance overhead will be huge... Thank you

    Read the article

  • VB.net Excel sorting

    - by Lora
    I am trying to get a macro convert from VBA over to vb.net and I am getting a type mismatched error and can't figure it out. I am hoping someone here will be able to help me. This is the code. Sub SortRawData() Dim oSheet As Excel.Worksheet Dim oRange As Excel.Range Try oSheet = SetActiveSheet(mLocalDocument, "Sheet 1") oRange = mApplication.ActiveSheet.UsedRange oRange.Sort(Key1:=oRange("J2"), Order1:=Excel.XlSortOrder.xlAscending, _ Header:=Excel.XlYesNoGuess.xlYes, OrderCustom:=1, MatchCase:=False, _ Orientation:=Excel.XlSortOrientation.xlSortColumns, _ DataOption1:=Excel.XlSortDataOption.xlSortNormal, _ DataOption2:=Excel.XlSortDataOption.xlSortNormal, _ DataOption3:=Excel.XlSortDataOption.xlSortNormal) Catch ex As Exception ErrorHandler.HandleError(ex.Message, ex.Source, ex.StackTrace) End Try End Sub This is the code from the macro Sub SortRawData(ByRef poRange As Range) Set poRange = Application.ActiveSheet.UsedRange poRange.Sort Key1:=Range("J2"), Order1:=xlAscending _ , Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:= _ xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _ DataOption3:=xlSortNormal poRange.Sort Key1:=Range("D2"), Order1:=xlAscending, _ Key2:=Range("H2"), Order2:=xlAscending, _ Key3:=Range("L2"), Order3:=xlAscending, _ Header:=xlYes, OrderCustom:=1, MatchCase:=False, Orientation:= _ xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _ DataOption3:=xlSortNormal End Sub Any help would be appreciated. Thanks!

    Read the article

  • Using query parameter in Access report

    - by Dave
    I have a very basic access database where a query returns the sales made within a set start date and a set end date. The dates are set with two pop up boxes for the user to enter, first the start date, and then the end date. I have a report running off the back of this. How can I (using VBA) get at these dates then display them on the report - ie. the report says "Sales for Period:" and then shows the "from date" and the "to date" that the user input.

    Read the article

  • Push or Pull to Excel for reporting data

    - by Nathan Fisher
    I am unsure which is the best way to go here. I have a third party Excel 2003 spreadsheet that needs to be filled in on a monthly basis and emailed. Currently it is a manual process and I am in the process of automating the generation of the spreadsheet. I have been throwing around different ideas of how to get the data into the spreadsheet. I have thought of using SSRS to create a report that is in a similar format and get the user to cut and past. Alternatively writing a VBA addin that retrieves that data from a webservice and then adds the data to the spreadsheet. Or using the third party spreadsheet as a template and open it on the server via oledb and adding the data then serving it as a downloadable file. Which is better or are the better solutions out there?

    Read the article

  • Why does Excel expose an 'Evaluate' method at all?

    - by jtolle
    A few questions have come up recently involving the Application.Evaluate method callable from Excel VBA. The old XLM macro language also exposes an EVALUATE() function. Both can be quite useful. Does anyone know why the general expression evaluator is exposed, though? My own hunch is that Excel needed to give people a way to get ranges from string addresses, and to get the value of named formulas, and just opening a portal to the expression evaluator was the easiest way. But of course you don't need the ability to evaluate arbitrary expressions just to do that. Application.Evaluate seems kind of...unfinished. It isn't very well documented, and there are quite a few quirks and limitations (as described by Charles Williams here: http://www.decisionmodels.com/calcsecretsh.htm) with what is exposed. I suppose the answer could be simply "why not expose it?", but I'd be interested to know what design decisions led to this feature. Failing that, I'd be interested to hear other hunches.

    Read the article

  • How can I perform a web query in C# similar to the Data > Import External Data > New Web Query in Mi

    - by TNT
    I need to pull data from a table on a website. I can easily do this in VBA using the Web Query, but I need to do this in C#. I'm just having some trouble figuring out how to properly convert the code. I got something close, but it's returning HTML with the data. I just want the data. Any help would be great. The block of code giving me issues is below: Private Function GetData(ByVal theURL As String, ByVal theRow As Integer, ByVal thePosition As Integer, ByVal theColumn As String, ByVal theTable As Integer) With ActiveSheet.QueryTables.Add(Connection:="URL;" + theURL, Destination:=Sheet2.Range(theColumn & theRow + 1)) .Name = "op?s=" + Mid(theURL, thePosition + 1) + "_1" .PreserveFormatting = True .AdjustColumnWidth = True .WebTables = theTable .Refresh BackgroundQuery:=False End With End Function

    Read the article

  • Inserting Rows Without Selecting Anyting?

    - by Soo
    Hello SO, I'm working in VBA and want to insert a row in a specific location without selecting it. The issue I'm having is that after the row is selected, the spreadsheet is scrolled down to that row when the script is finished running. I want to be able to do this without the spreadsheet being scrolled down to the inserted row. Rows(i & ":" & i).Select ActiveCell.EntireRow.Insert I don't want to select A1 to get to the top.

    Read the article

  • How to code an ALL option into a Combo Box

    - by Edmond
    I have a combo box on my form with the choice of choosing organization 10, 20, 30.... I have added ALL to the combo list box, but am having trouble implementing an all statement in VBA. Below is the case statement I have to get info from organizations 10, 20, 30. How do I get ALL to generate?? Case Is = 1 If cboOrg.ListIndex < 0 Then Call msg("Please select your organization!") Exit Sub End If sQ = sQ & " CC LIKE '" & cboOrg.Value & "*'" ORGCC = Trim(cboOrg.Value)

    Read the article

  • wanting to move up from ms access, thinking .net? visual studio?

    - by Tristan Lear
    So I wrote a project-management program for a small business using Microsoft Access 2007. Now they've requested lots of additional features (timekeeping, privileged data tiers ...) I personally use Linux, but the whole office uses Windows. I'm relatively new to programming but like to teach myself using projects like this. I'm right on the edge on this -- I can't really tell what the path of least resistance here is: do I stay in access + VBA and teach myself a dying, annoying language -- while struggling against all the limitations of Access? Or do I move to something else? Python seems simple enough ... Whatever I use, i need to be able to offer a GUI.

    Read the article

  • Create an automatic date stamp in excel from an entry.

    - by Obfus
    I am trying to have a date stamp event happen in column B when an entry is made in column A. Now i can do this in VBA with no problem, the trouble i am running into is there is also a entry that will eventually go in say column D and would need a date stamp in column E as well. is this possible. here is a sample of the code i have used so far. Private Sub Worksheet_Change(ByVal Target As Range) For Each Cell In Target If Cell.Column <= 3 Then If Cells(Cell.Row, 1) < "" Then Cells(Cell.Row, 2) = Now End If Next Cell End Sub

    Read the article

  • Check whether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

  • Check wether Excel file is Password protected

    - by Torben Klein
    I am trying to open an Excel (xlsm) file via VBA. It may or may not be protected with a (known) password. I am using this code: On Error Resume Next Workbooks.Open filename, Password:=user_entered_pw opened = (Err.Number=0) On Error Goto 0 Now, this works fine if the workbook has a password. But if it is unprotected, it can NOT be opened. Apparently this is a bug in XL2007 if there is also workbook structure protection active. (http://vbaadventures.blogspot.com/2009/01/possible-error-in-excel-2007.html). On old XL2003, supplying a password would open both unprotected and password protected file. I tried: Workbooks.Open filename, Password:=user_entered_pw If (Err.Number <> 0) Then workbooks.open filename This works for unprotected and protected file. However if the user enters a wrong password it runs into the second line and pops up the "enter password" prompt, which I do not want. How to get around this?

    Read the article

  • getting the heading of a selected text in word

    - by Thunder
    Hi, I am working With Microsoft Word VBA,macros. My question : Is there way to get sub-topic and master-topic that precedes a selected body text ? Here is an example: Master topic (level 1) sub-topic 1 (level 2) body text a body text b body text c sub-topic 2 (level 2) body text d body text e Other MISC topics (level 2) body text f body text g body text h Here if 'bodytext e' is selected I would like to run a macro and get the result as 'Master topic:sub-topic 1' I have tried with range,parent ,Scope.Information(wdActiveEndSectionNumber) etc but nothing seem to work!!! Thanks in Advance

    Read the article

  • Counting characters in an Access database column using SQL

    - by jzr
    I have the following table col1 col2 col3 col4 ==== ==== ==== ===== 1233 4566 ABCD CDEF 1233 4566 ACD1 CDEF 1233 4566 D1AF CDEF I need to count the characters in col3, so from the data in the previous table it would be: char count ==== ===== A 3 B 1 C 2 D 3 F 1 1 2 Is this possible to achieve by using SQL only? At the moment I am thinking of passing a parameter in to SQL query and count the characters one by one and then sum, however I did not start the VBA part yet, and frankly wouldn't want to do that. This is my query at the moment: PARAMETERS X Long; SELECT First(Mid(TABLE.col3,X,1)) AS [col3 Field], Count(Mid(TABLE.col3,X,1)) AS Dcount FROM TEST GROUP BY Mid(TABLE.col3,X,1) HAVING (((Count(Mid([TABLE].[col3],[X],1)))>=1)); Ideas and help are much appreciated, as I don't usually work with Access and SQL.

    Read the article

  • Creating an Excel Template for different data size

    - by dassouki
    I created an excel template for a file i've done for a routine work calculation. The file takes data from the data logger and does some analysis on it and outputs one number regardless of the input size. The problem I'm having is i have to modify the sheet to suit the number of rows, as everyday the data logger outputs a different number of rows. there are about 15 sheets in the workbook and it's annoying to have to change everyone of them everyday. What i'd like to do input the data logger csv, and boom the result gets outputted. Is there a way through vba or not to ahieve

    Read the article

  • Excel - Combine multiple columns into one column

    - by Akib
    Hey everyone. I'm new to excel and VBA and I'm stuck at this problem. I have multiple lists that are in separate columns in excel. What I need to do is combine these columns of data into one big column. I do not care if there are duplicate entries, however I want it to skip row 1 of each column. ROW1| 1 2 3 ROW2| A D G ROW3| B E H ROW4| C F I should combine into A B C D E F G H I The first row of each column needs to be skipped.

    Read the article

  • Ms Excel Problem Linking Range in Source Document to Custom Function in Target Document

    - by user261935
    I have some customer MS Excel VBA code (MS Excel 2007) that takes a range as input and then does some work on it (it is quite a large range). I want to use a separate excel document as the source of the range data. If I have both the source and target document open then the function works just fine. If I have only the target document open I get #Value! returned and stepping through in the debugger I see "Error 2023" in the data value passed in. Any ideas how I make this work without having to open both spreadsheets simultaneously?

    Read the article

  • best content on how to deploy and share a VSTO solution

    - by ooo
    with the push to leverage visual studio and dotnet with office based solutions, especially excel, where is the best article or information on how having office sheet with additional binaries and assemblies is sharable. Do this external code get packaged with the spreadsheet what if people start emailing the spreadsheet around. Is there any overhead of this additional assemblies. Is there risk of the binaries getting detached from the spreadsheet It seems like microsoft has been pushing VSTO for over 5 years now but you read lots of mixed reviews and issues. Are we at the point where companies that do large VBA excel solutions can fully migrate over to dotnet without any real worries?

    Read the article

  • MS Access "#Name?" in unbound field on SOME machines

    - by alkorya
    I have a datasheet form bound to table. I added 2 unbound fields and set their Control Source properties to user defined VBA functions: 1. ConcatRelated (http://allenbrowne.com/func-concat.html) 2. Custom function that returns a string: Public Function GetLowestSatatus(LookupField As String, JSAID As Integer) As String On Error Resume Next GetLowestSatatus = DLookup(LookupField, "JsaStatuses", "ID=" & DMin("StatusID", "Tasks", "JSAID =" & JSAID)) End Function It works fine on my and some other machines but there are machines I got "#Name?" in these 2 unbound fields. All machines configured identically. Any ideas? Thank you!

    Read the article

  • Repurpose builtin Word commands - access original command within repurposed function

    - by Aurril
    It is possible to repurpose a Word builtin command in Word 2007 using the customUI.xml file. Example: <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui"> <commands> <command idMso="Save" onAction="MySave"/> </commands> </customUI> I then have to define a callback function in VBA which is used instead of the builtin function: 'Callback for Save onAction Sub MySave(control As IRibbonControl, ByRef cancelDefault) someFancyPreparationFunction oldSaveFunction ' Where, how? someOtherFancyAfterWorkFunction End Sub And here is my problem, if I want to reuse internal functionality in my repurposed Function, I don't know how to access it. My example is trivial and the save could be easily rebuilt by a call to ThisDocument.save but as I said, it is just an example to show the problem. A call to CommandBars.ExecuteMso('Save') would call my repurposed function and not the original one. Any ideas on how to access the internal functionality after repurposing would be very appreciated!

    Read the article

  • Inserting new argument to table through search form of another table

    - by owca
    In my database I have a form for searching products (fields : id, name, manufacturer_id[set to display manufacturer's name], category_id, price). I would like to have the ability of adding manufacturers through this form. So I've created vba script but it does not work. Still when I enter new name it gives me prompt to "Select element from the list". What am I doing wrong ? Private Sub manufacturer_id_NotInTheList(NewData As String, Response As Integer) Dim strSQL As String, strInfo As String strInfo = "Manufacturer " & NewData & " is not on the list." & vbCrLf & "Add?" If MsgBox(strInfo, vbYesNo + vbQuestion, "Element not on the list") = vbYes Then strSQL = "INSERT INTO manufacturer (name, country, id_distributor) VALUES ('" & NewData & "','Undefined', '0');" DoCmd.SetWarnings (False) DoCmd.RunSQL strSQL Response = acDataErrAdded Else Response = acDataErrContinue NewData = "" Me.manufacturer_id.Text = "" End If End Sub

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >