I have created a macro file which will fetch the data from sql server. Here is the code
f Me.Cmbchoose.Value = "" Then MsgBox "Please Choose From the drop down Menu!!", vbExclamation Exit Sub End If If Me.Cmbchoose.Value = "Merchants Reports" Then Dim oConn As ADODB.Connection
[Code] .....
The code is working fine. Now my question is that I want to access it from my home. How do I do that without DSN set up?
I have created a macro that creates a powerpoint from excel in office 2010. I have followed all the required steps, like adding object library and all. but still many times the PowerPoint crashes at slide7, 8 or 9 and have to restart. I generally get the above given error.
Code: Sub CreatePowerPoint() Application.ScreenUpdating = False 'Macro Created by Pallavi NC (pallavi.nc@hp.com) 'Add a reference to the Microsoft PowerPoint Library by: '1. Go to Tools in the VBA menu '2. Click on Reference '3. Scroll down to Microsoft PowerPoint X.0 Object Library, check the box, and press Okay 'First we declare the variables we will be using
I've been unsuccessful in trying to write a formula that retrieves a single result based on two criteria (from a large set of data on a separate worksheet). I've tried various INDEX MATCH combinations but no luck.
A B C D E
1 DATE TEAM PITCHERS RESULT
2 4/1 nyy Sabathia ???????
[Code] ........
So this is a very simplified version of my real data set which is about 20 times this size. The first worksheet is where I want to store my retrieved results (lets say D2 for example). I want to retrieve data from the second worksheet that matches two criteria (exactly) originating from my first worksheet. The two criteria to be matched from the first worksheet are, for example, A1 (sabathia) and F2 (the date 4/8). The complicated part is the desired result should be from the corresponding K/9 column in the second sheet, which in this case (based on sabathia and 4/8 criteria) is I2 (result would be 3). It's complicated since I can't just tell the formula to look down a specific K/9 column, I need to search ALL the K/9 columns in the sheet (of which there are many). Is this even possible with some sort of nested INDEX MATCH? Any possibilities outside of VBA programming, or is that the only way?
I am running 2 audits on aspects of patient care. The first audit records a unique number that identifies the patient, and then a series of answers on demographics, and other stuff.
The second audit also records the unique number, and collects some other data on the particular patient at a later point in time (medication usage, levels of pain etc).
So in theory both audits will collect different information on the same patients. In practice, some patients will be missed and there won't be matching data sets. The order of collection won't be the same either, ie Audit 1 might be in the order of Patient 1,2,3,4 etc but Audit 2 might be patient 2,4,1,3
For various reasons these two data collection tools are not linked, and I end up with a spreadsheet for audit 1 and a spreadsheet for audit 2.
I need to merge these so that I can see all of the data for a particular patient at a glance, and where the gaps are, and apply some statistics to it etc. I could sort both lists by the unique audit number so that they are in order, and then copy blocks of data over from one sheet to the next, but there will be records missing, i might make a mistake with the alignment, and I'm sure there must be a better way.
I am using Excel 2010. Each audit case has about 50 columns of data for Audit 1 and 30 columns for Audit 2 . There will be ~20 new records (Rows) created each week that I want to progressively merge.
I have a spreadsheet which I used in a previous job, which was set up by our old IT Department. Basically, it allows me to save information onto it, which I can then retrieve, (in any conditions/search fields i.e. in a date range etc) but the problem is; when I try to use it on my laptop, I look at the editor used for macros, I can see that the spreadsheet is linked to the servers of my old company. Therefore, I cannot use it myself
I do not know a lot about macros etc. but I can send a copy of the spreadsheet to anybody who is willing to help!
I think it is just a case of changing the macros/strings of where to draw and save information to/from, but I don;t know.
I am looking to further improve this code by adding the functionality of logging to a secure HTTPS server using username and password.
Code:
Sub TestFileExistsandDownload() 'This code will test a web address to see if a file exists 'If the file exists, it will download the file. ' It's a mixture of code retreived from 2 sites: ' [URL]... ' [URL]....
I'm trying to open a file from server.After doing all the changes I have to save the file back to the server in the same name. It is asking for save as option.it shouldn't. I want to save the file in the same path and in same name without asking the option of "Save as". I hv full permission for editing the file
I try to run a macro on my workbook everytime I open it by getting the data from the ftp file. This will be the service number for my customer. Both the excel and the data file are located in the ftp, so that I can retrieve the file wherever I go. Basically I got some code from the internet which work fine on the local network, but once it come to ftp server I am stuck there.
Public Function NextSeqNumber(Optional sFileName As String, Optional nSeqNumber As Long = -1) As Long Const sDEFAULT_PATH As String = "Ftp://mycompany.com" Const sDEFAULT_FNAME As String = "Service.txt" Dim nFileNumber As Long nFileNumber = FreeFile If sFileName = "" Then sFileName = sDEFAULT_FNAME If InStr(sFileName, Application.PathSeparator) = 0 Then _ sFileName = sDEFAULT_PATH & Application.PathSeparator & sFileName If nSeqNumber = -1& Then If Dir(sFileName) <> "" Then Open sFileName For Input As nFileNumber Input #nFileNumber, nSeqNumber..................
I'm trying to extract data from one excel to another. I'm able to extract data without a problem copying cell to cell or a count, but I'm not able to get a return by calculating the sum. There must be a way?
We have a number of internal office servers (Active Directory - Exchange - SharePoint "free" etc etc usual stuff) and I need to create an uptime/downtime calculator in excel with the facility to record the information on a daily, monthly and yearly bases but not sure how to go about this.
I would like a way to record on a daily bases what the uptime/downtime has been for each server and then to record the same for that month in a percentage.
For example in a 24hr period for each month of the year:
For that day Active Directory Server was UP for 24hrs. (100% uptime) - (0% downtime) X by the number of days in the month i.e. Over the month Active Directory has been UP for. (XX% uptime) - (XX% downtime)
Exchange Server was DOWN for 1hrs. (95.833% uptime) - (x% downtime) X by the number of days in the month i.e. Over the month Exchange has been UP for. (XX% uptime) - (XX% downtime)
SharePoint Server was DOWN for 1hrs. (95.833% uptime) - (x% downtime) X by the number of days in the month i.e. Over the month SharePoint has been UP for. (XX% uptime) - (XX% downtime)
I need to run multiple queries and insert their results into Excel cells. Each query will return only one result (a number, or a null). What is the best way to accomplish this?
Below is an example of the code I'm currently using. It does return data to the cell specified, but I'm guessing there's an easier way to populate multiple cells with the results of multiple queries.
I have code which is convert some range of excel to Png and store to my local drive. This code is working fine.
I have created web site on my intranet and the data store on server, now i use this code and pickup image from my local storage i.e. from "C" Drive and paste in to service folder, bcoz i uploaded report as a Image and it timely refreshed and changed
Is there any way so this code directly store to service folder, if i can use IP address or HTTP path
I had tried with HTTP path but it is not working.
My server path is [URL] ....... OR
Is there any way when local folder got image than automatically server folder also get same image...
Sub bah() ''' Set Range you want to export to file Dim rgExp As Range: Set rgExp = Range("B2:C6") ''' Copy range as picture onto Clipboard rgExp.CopyPicture Appearance:=xlScreen, format:=xlBitmap ''' Create an empty chart with exact size of range copied
How to pull data with a VLOOKUP to a file located on a Server.
My big problem is not understanding the syntax of the Server location. I've provided it below (obviously with some character changes).
I have a file located on my Hard Drive. I need to perform a VLOOKUP from A2 on this spreadsheet. The File on the Server is called "LookupTest.xls". The Range of Data is from Sheet 1 and is from A2:C4 and I need to pull the data from column C depending on what is selected from A2 from the file on my HD. I understand how to use VLOOKUP, just not when I'm pointing to another file on a Server.
Server mapping from Windows Explorer:
rbbabc$ on 'RP17409 - ABC Database (AHSSRVVN678.tge.com)'
Again, that server mapping is fake, as I changed it, but this is how it looks on Windows Explorer.
I'm trying to keep a master file of Data on a spreadsheet found on a server so that one master file can be updated, and several other tools pull from that Master File on VLOOKUP, Validation Lists, etc.
I'm creating my first stored procedure ever and it looks relatively good so far. The problem is with passing the parameters, more exactly:
Arguments are of wrong type, are out of acceptable range, or are in confilict with one another
The essential part of the stored procedure looks like:
Code: CREATE PROC GetUserAuthForApp @User varchar(7), @application int AS
while the essential code calling it from VBA looks like:
Code: Dim strConn As String 'Connection string to SQL Server Dim strSQLtoExecute As String 'SQL query string to execute Dim oConn As ADODB.Connection 'Object for connecting Dim rs As ADODB.Recordset 'Object for recordset Dim cmd As ADODB.Command Dim prmUser As ADODB.Parameter Dim prmApplication As ADODB.Parameter Dim stProcName As String 'Stored Procedure name
Our small company only has 5 computers in it with mine acting as the "server". I want to put a macro on our customer order forms that all computers can access on the server that will save the file as 3 or 4 cell names serparated by commas and save it in a specific location on the server.
I got the macro to work perfectly on my computer but when I try to type in the appropriate path to the server the file gets saved in their My Documents folder 99% of the time. I did get it to work twice but it seembed to be completely random as it didn't work any of the times before or after.
I found the below code in one of the posts and it was working fine uptill few days back. now, i get the error Run Time error '-2147220975(80040211) The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
Sub CDO_Send_Workbook() Dim iMsg As Object Dim iConf As Object Dim wb As Workbook Dim WBname As String Application. ScreenUpdating = False Set wb = ActiveWorkbook WBname = wb. Name & " " & Format(Now, "dd-mm-yy h-mm-ss") & ".xls" wb.SaveCopyAs "C:/" & WBname Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") iConf.Load -1 ' CDO Source Defaults....................
I have a problem that I have several workbooks that are getting more widely used by a number of users and I'm starting to encounter problems. The workbooks open files from particlaur locations to retrieve information but I am finding that not everyone has the same drive letter for the same server or shared drive.
For example Server607 could be drive J: for me but drive N: for people in another department. Is there a way to refer to the server location in VBA when opening files rather than the drive path?
i have a file on network with below code following code give my computer date and time when i click the button but i want Server date and time or any website date and time.
we are useing windows 2000 Professional system for server and i know my server path .
Private Sub CommandButton1_Click() Sheet1. Range("c2") = Date Sheet1.Range("c3") = Now 'above code give my computer date and time 'but i want server or internet website time ' i know my server path and we are useing windows 2000 system on server End Sub
I've created some code to automate file downloads from a server using WinSCP. The code creates a .bat file and a .dat file containing a script to transfer files using WinSCP.
When the VBA code runs the script using Shell, the terminal window opens and closes in a flash and the download does not execute. However, if I execute the .bat file outside of VBA the whole download process works great!
Sub GetFilesFromServer()
Call GetLogin
Dim fs As Object Dim a As Object Dim retVal As Long Dim col As Long Dim row As Long Dim PBSPath As String Dim reportName As String Dim newName As String Dim targetDate As Long Dim reportDate As Long Dim targetDir As String
Is there any way to create a specific template that will extract information from PDF file and make it to an Excel File ? The Template would know each PDF and will know which information to extract to excel ?
VLookup function, formula that will allow a user pull up data either by name or an ID number. Heres a scenario:
Cell (C5) requires user to input "name" of employee being search. Cell (H5) if you do not know the correct spelling then use their ID number. The array is called "agentlist" which contains Name, ID #, hire date, SSI, title, and personal address.
Here's the formulas that I came with but it returning with a "n/a" response.
The cells within paranthesis are the locations were the data will be displayed. Am wondering if I would need two different arrays, one to locate by name and the other by their ID number? Hope this problem is clear.