Search Results

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

Page 33/48 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • What's the fastest way to check the availability of a SQL Server server?

    - by mwolfe02
    I have an MS Access program in use in multiple locations. It connects to MS SQL Server tables, but the server name is different in each location. I am looking for the fastest way to test for the existence of a server. The code I am currently using looks like this: ShellWait "sc \\" & ServerName & " qdescription MSSQLSERVER > " & Qt(fn) FNum = FreeFile() Open fn For Input As #FNum Line Input #FNum, Result Close #FNum Kill fn If InStr(Result, "SUCCESS") Then ... ShellWait: executes a shell command and waits for it to finish Qt: wraps a string in double quotes fn: temporary filename variable I run the above code against a list of server names (of which only one is normally available). The code takes about one second if the server is available and takes about 8 seconds for each server that is unavailable. I'd like to get both of these lower, if possible, but especially the fail case as this one happens most often.

    Read the article

  • Fixed number of rows In Access Report

    - by Pronek
    Hello All, I am having tried a access 2007 report with fixed numbers of rows (records) per page. For example, I like to fix total number of records (rows) to 10 per page while underlying query might have 5 records in some criteria or 15 records in some case. If any idea, please share me. TIA ProNek

    Read the article

  • How to wrap images into a Excel Add-in 2003

    - by nimo
    hi, I'm having a excel add-in with several menu items. Each menu item embedded with a image. I'm loading picture to menu item using LoadPicture function where I gave the absolute path to image location. In order to make the add-in distributable I need to provide a relative path. Appropriate anyone can suggest me how to do this. Thank you

    Read the article

  • Using Excel To Read Access Without MS Access On Computer

    - by Tom Clark
    I have written code that joins two table in access, using criteria supplied from drop down lists in excel and then returns the data to a specific location on the spreadsheet (titles already on the sheet). This works fine on my box and others with MS Access on the machine, but the purpose of writing this was to give people (associates) that dont have the MS Access on their machines (which is most of them) to be able to do simple queries to the database. When we try to run this on a machine without MS Access, we are getting the error message "Compile Error: Cant find project or library." Since this works fine on any machine so far that has Access, but not the others I am wondering if this is not possible without the actual Access software. Any help or insight would be appreciated. Tom

    Read the article

  • How can I iterate through table styles only?

    - by Vitali Climenco
    I have a procedure that iterates through the styles available to a document: Sub EnumerateStyles() For Each Style in ActiveDocument.Styles `some custom code Next End Sub I do not need all the styles, and just those that are applicable to tables only. How can I programmatically filter the styles? Thank you

    Read the article

  • Subscript out of range error

    - by Edmond
    Private Sub sendemail(esubj) ROW_BEGIN = 1 ROW_END = 72 Sheets("Input").Select Range("A" & ROW_BEGIN & ":S" & ROW_END).Select Range("A" & ROW_BEGIN).Select fileL = "\\fire\school\FINANCE\Report\FY10\Key Indicator\" fileL = fileL & (Left(Range("I7"), 3)) & Right(Year(Date), 2) fileL = fileL & "\Key Report - " & myfdate & ".xls" I have a workbook with a spreadsheet tab named Input. When I try to run it, I get the Subscript out of range message. Why cant it pull from the Input spreadsheet??

    Read the article

  • Extract the vb code associated with a macro attached to an Action button in PowerPoint

    - by Patricker
    I have about 25 PowerPoint presentations, each with at least 45 slides. On each slide is a question with four possible answers and a help button which provides a hint relevant to the question. Each of the answers and the help button is a PowerPoint Action button that launches a macro. I am attempting to migrate all the questions/answers/hints into a SQL Database. I've worked with Office.Interop before when working with Excel and Word and I have plenty of SQL DB experience, so I don't foresee any issues with actually extracting the text portion of the question and answer and putting it into the db. What I have no idea how to do is given an object on a slide - get the action button info - Get the macro name - and finally get the macro's vb code. From there I can figure out how to parse out which is the correct answer and what the text of the hint is. Any help/ideas would be greatly appreciated. The guy I'm doing this for said he is willing to do it by hand... but that would take a while.

    Read the article

  • In Microsoft Access 03. Creating 2 critera for one report

    - by Edmond
    In Microsoft access 03.I am creating a database and want the user to have the option of two critera. Critera 1, the output on the report is filtered by accounts that have a varinace of =10% or <=-10%. Or, Critera 2, allow the user to be able to input a specific variance on a form, that will only output on a report accounts that have that specific variance.

    Read the article

  • Excel 2003 - How to build my own XLA?

    - by Justin
    How can you make the .xla file if you want to create your own xla? I have the code, classes, shapes, etc....what is the process to making an xla file to point to? I know that I have to put it in my program files folder, and then go through the steps to adding an "add-in" in xls...but i mean actually saving an xla file to point to.... can i simply write all this in xls and then save it as file type xla?? because i have tried to do that but I get an error that it is not a valid add in when I am in a spreadsheet trying to point to it? thanks!

    Read the article

  • multi-thread in MS Access, async processing

    - by LanguaFlash
    I know that title sounds crazy but here is my situation. After a certain user event I need to update a couple tables that are "unrelated" to what the user is currently doing. Currently this takes a couple seconds to execute and causes the user a certain amount of frustration. Is there a way to perform my update in a second process or in a manner that doesn't "freeze" the UI of my app while it is processing? Thanks

    Read the article

  • how can i program this ui box

    - by silverkid
    in what way can this be programmed. a UI box that displays random number between min and max value for 2 seconds then shows blank for 2 seconds then shows another random numer for 2 seconds then shows blank for 10 seonds and then repeats the cycle infitely until form closed. Font of the text to be configurable. any help at all will be appreciated.

    Read the article

  • Visual Studio 2008 Macro for Building does not block thread

    - by Climber104
    Hello, I am trying to write a macro for Building my application, kicking off an external tool, and ataching the debugger to that external tool. Everything is working except for the building. It builds, but it is not blocking the thread so the external tool gets kicked off before it can finish. Is there a way I can run ExecuteCommand and wait for the thread to finish? Code is below: DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Build") DTE.ExecuteCommand("Tools.ExternalCommand11") Try Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default") Dim dbgeng(1) As EnvDTE80.Engine dbgeng(0) = trans.Engines.Item("Managed") Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "MINIPC").Item("_nStep.exe") proc2.Attach2(dbgeng) Catch ex As System.Exception MsgBox(ex.Message) End Try

    Read the article

  • In MS Access form, how to color background of selected record?

    - by PowerUser
    I have a somewhat complicated looking Access Form with a continuous display (meaning multiple records are shown at once). I'd like to change the background color of the selected record only so the end-user can easily tell which record they are on. I'm thinking of perhaps a conditional format or maybe something like this: Private Sub Detail_HasFocus() Detail.BackColor(me.color)=vbBlue End Sub and something similar for when that row loses focus. This code snippet obviously won't work, but it's the kind of code I'd like to achieve.

    Read the article

  • ms-access: changing the link to a database

    - by every_answer_gets_a_point
    i have an ms-access database front end that connects to an access backend. i have changed the location of the backend and i need to be able to update the link to it. how do i do this? when i open the front end and try to see data, it says "the microsoft office access database engine cannot open or write to the file ......... "

    Read the article

  • Trouble Avoiding Microsoft Outlook's Email Warning

    - by talbright
    I have a set of records in Microsoft Access that I am trying to send in an Email. The email feature works great. Except a warning message pops up every time a message is ready to send, and the user has to click "Allow" or "Deny" for every email sent. I looked up a workaround, and have been following the tutorial for it: http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-Without-Security-Warning. My problem is that when I put my message in the function it always returns false, and the message fails. Any help would be appreciated. Dim sendMail As Boolean Dim strMessage As String strMessage = Some Message sendMail = FnSafeSendEmail(![Email Id], "Subject", strMessage) The entire "FnSafeSendEmail" function can be found in the link provided. These are the parameters though. Public Function FnSendMailSafe(strTo As String, _ strCC As String, _ strBCC As String, _ strSubject As String, _ strMessageBody As String, _ Optional strAttachments As String) As Boolean The error is thrown on this line of the function. Dim blnSuccessful As Boolean blnSuccessful = objOutlook.FnSendMailSafe(strTo, strCC, strBCC, _ strSubject, strMessageBody, _ strAttachmentPaths)

    Read the article

  • about option buttons in User form

    - by Mars
    I have a question: I need to create a user form that contain that usual OK and Cancel Buttons. It also should contain two sets of Options buttons, each set placed inside a frame. The captions on the first set should be basketball, baseball, football, the captions on the second set should be watch on TV and Go to games. I need to write the event handlers and code in a module so that when the program runs, the user sees the form. If the user makes a couple of choices and clicks OK, he should see a message like "Your favorite sport is basketball, and you usually watch on TV." If the user clicks Cancel, the message "Sorry you don't want to play" should appear. I think I almost have it working, but I don't know why I cannot successfully execute the Macro. My Code is : Option Explicit Private Sub CommandButton2_Click() MsgBox ("sorry if you don't want to play") End Sub Private Sub commandbuttons_Click() Dim optbasket As String, optbaseball As String, optfootball As String Dim optwog As String, optgtg As String Select Case True Case optbasket optbasket = True Case optbaseball optbaseball = True Case optfootball optfootball = True End Select If optwog Then optwog = True Else optgtg = True End If btnok = MsgBox("you favorite sport is " & Frame1.Value & "you usually " & Frame2.Value & ",") End Sub Private Sub OptionButton1_Click() End Sub Private Sub btmcancel_Click() End Sub Private Sub btnok_Click() End Sub Private Sub Frame1_Click() End Sub Private Sub Frame2_Click() End Sub Private Sub optbaseball_Click() End Sub Private Sub optbasketball_Click() End Sub Private Sub optfootball_Click() End Sub Thank you very much!!!

    Read the article

  • Update access table rst with named cell values from excel

    - by uZI
    I have got a table in access that I loop through using a DAO recordset. For every recordset I take a bunch of data to an excel spreadsheet and run it through a model in excel. This produces a bunch of results in excel which are calculated in named cells. I want to be able to update the current recordset in access with these results but am having a tough time doing it. I have the following code code to create a DAO recordset code to move to first record code to parse data to excel code to run a bunch of stuff in excel including a goal seek to calculate results next I use the follwoing code without success With MyXL strSQL = "UPDATE ProductPricing SET Profit = " & .Names("Profit") & ";" End With Code to move to next record and loop until EOF any help is appreciated thanks

    Read the article

  • Make Excel Defined Names within a worksheet to be global

    - by idazuwaika
    Hi, I wrote Powershell script to copy a worksheet from a workbook A to another workbook B. The worksheet contains define names for ranges within that sheet. Originally, the defined names are global in workbook A, ie. can be referenced from any worksheets within workbook A. But now, after copy to worksheet B, the defined names are limited to that worksheet only. How to I programmatically (via Powershell script preferably) make all those named range global i.e. can be referenced from all worksheets within workbook B. Some codes for clarity. #Script to update SOP from 5.1 to 5.2 $missing = [System.Type]::missing #Open files $excel = New-Object -Com Excel.Application $excel.Visible = $False $excel.DisplayAlerts = $False $newTemplate = "C:\WorkbookA.xls" $wbTemplate = $excel.Workbooks.Open($newTemplate) $oldSop = "C:\WorkbookB.xls" $wbOldSop = $excel.Workbooks.Open($oldSop) #Delete 'DATA' worksheet from old file $wsOldData = $wbOldSop.Worksheets.Item("DATA") $wsOldData.Delete() #Copy new 'DATA' worksheet to old file $wbTemplate.Worksheets.Item("DATA").Copy($missing,$wbOldSop.Worksheets.Item("STATUS")) #Save $wbOldSop.Save() $wbOldSop.Close() #Quit Excel $excel.Quit()

    Read the article

  • MSForms.ListBox Type Mismatch in Access

    - by Jason
    I have an Access database where I use a Tab control (without tabs) to simulate a wizard. One of the tab pages has an MSForms.ListBox control called lstPorts, and a button named cmdAdd which adds the contents of a textbox to the List Box. I then try to keep the contents of the ListBox sorted. However, the call to the Sort method causes a type mismatch. Here is the cmdAdd_Click() code behind: Private Sub cmdAdd_Click() Dim test As MSForms.ListBox lstPorts2.AddItem (txtPortName) Call SortListBox(lstPorts2) End Sub Here is the SortListBox Sub: Public Sub SortListBox(ByRef oLb As MSForms.ListBox) Dim vaItems As Variant Dim i As Long, j As Long Dim vTemp As Variant 'Put the items in a variant array vaItems = oLb.List For i = LBound(vaItems, 1) To UBound(vaItems, 1) - 1 For j = i + 1 To UBound(vaItems, 1) If vaItems(i, 0) > vaItems(j, 0) Then vTemp = vaItems(i, 0) vaItems(i, 0) = vaItems(j, 0) vaItems(j, 0) = vTemp End If Next j Next i 'Clear the listbox oLb.Clear 'Add the sorted array back to the listbox For i = LBound(vaItems, 1) To UBound(vaItems, 1) oLb.AddItem vaItems(i, 0) Next i End Sub Any help out there? Since the Sort routine explicitly references the MSForms.ListBox, most of the results from Google aren't applicable. Jason

    Read the article

  • Need to copy columns H,K,L From one excel workbook to new workbook using Excel Macro

    - by bhargav reddy
    I have a excel workbook A.xlsx with columns A through T, now i need to copy specific columns H,K,L to a new workbook which would be created while i run a macro. I was able to successfully copy a range of columns from one worksheet to another, but i am not finding a way to copy specific columns to a new workbook. Private Sub copy_sub() Sheets("Sheet1").Columns("H:K").Copy Sheets("Sheet2").Range("A1") End Sub

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >