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 workbook that is being used by many individuals. Within it contains links to an external workbook on a server. Currently the links in the workbook map the server to drive "T".
If a different user maps the same server to another drive letter, I assume these links need to be updated with the drive letter he/she is using for that server?
I have a workbook with multiple worksheets, recording time in and time out of temporary employees. The first worksheet is a summary of each weekly timesheet. I would like to make it so the names only have to be typed once and will fill in on the subsequent sheets. I linked the cells, but since the employees may not work every week--we do not know in advance whether they should be included on the time summary at the beginning of the month.
Time Summary Worksheet Last Name..First Name..Reg Time..OT Bilson.........Bill.............40..........12 Samson......John...........40..........5
Time-Week 1 Last Name..First Name..Day1..Day 2, etc. Bilson.........Bill.............12....14 Samson......John...........8.....10
Time-Week 2...
The problem comes when I try to add a row for a new employee. If I add it to the Time Summary worksheet all the data in the Weekly timesheet worksheets is thrown off.
I have a column of cells, some blank, some containing just numbers, some containing just letters, some containing numbers preceded by the the letter 'p'
E.g.
frt 34.2 36
p34.5
In the cells containing the number preceded by the 'p' - i would like to remove the 'p' leaving just the number, with all other cells remaining unchanged.
Is there a VBA command to get the letters, instead of the numbers, of the column of a selected cell?
I have to letter a list whihc means setting up a loop using character codes.
I may have to go into double letters so I am working on how I would set up the loop for if and when it gets past 90 and starts on double letters. so far the highest is the letter "U"
of course the easiest would be to pick up a column value as a letter
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..................
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 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
I am busy writing projects and the macros that I write reference external files (no surprise there). Normally, all referenced files are on the company's main G: drive but recently the company have started the process of re-appraising all access authorities for the folders in the G: drive. This has necessitated that they create a new drive (called J:) and folders and users are being migrated over there as they have been cleaned and approved.
All of this means that some of my users reference J: and some G: and my macros are intermittently falling over because of it. For each user, all the files that they will need will be on either the J: or the G: drive, but not both.
All of the above leads me to ask the following question... How can I build into the macros a "Check what drive you're on and use that letter" line of code
A user has an excel document and there are 5 specific cells they need to populate. The data is in one of our SQL databases. Is it possible to create a new copy of that excel doc with those fields populated for each record? There are around 2000 records they don't want to manually populate each one.
Any code that will grab the names of all files from all directories on an FTP server? I have the path & credentials to get to them, but I need a process to drop their names into a spreadsheet to compare against a list of files loaded onto a SQL database.
The directory structure on the server is subject to change, as are the number of files in each repository.