Which Drive Am I On? {[()]}

Feb 21, 2007

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

View 4 Replies


ADVERTISEMENT

Drive Mapping

Nov 18, 2009

Currently I am using this ......

View 9 Replies View Related

Hyperlink To The CD Drive

Nov 20, 2009

I use the Hyperlink to open PDF files that are on the CD drive from my spreadsheet. I am on Windows XP and the CD drive is the D drive. In Vista the CD drive is the E drive.

When I take the spreadsheet to a Vista machine the link fails as there is no D drive.

Is there any to code the path of the Hyperlink so it will go to th default CD drive for that computer.

View 9 Replies View Related

Saving To A Network Drive

Jan 6, 2009

We have a form that is completed by our employees and emailed to a central group email address that up to 8 employees within our team can access. When one of our 8 team members open the file sent they need to add comments to it and then save it in a central directory on one of our network drives.

Now the problem I have is that we all have the network drive mapped to a different letter.

Is there a way that I can have a macro (see below for current macro that does not work) save to a network path and not a drive letter.

View 10 Replies View Related

Save To Flash Drive?

May 18, 2012

I have a an excel workbook that is distributed on a flash drive. Currently a Save As Macro copies "A1" as the file name and then opens a screen to allows the user to save that filename to a location that the user selects. What I would like to have happen is for a command button to start a macro that would automatically save the file back to the flash drive that the master workbook is located.

View 3 Replies View Related

Testing If Drive Exists?

Jun 30, 2013

I have a program that relies on a remote drive being open and ready. My current tactic (which works perfectly well) is to have a file in the destination drive and ask the date that file was created. If an error occurs I know the destination drive is not ready.

Code:
On Error Resume Next
temp = FileDateTime(destDrive & "xDeletedStuff" & "testFile.txt")
If Err Then
MsgBox "Destination Drive / Folder Not Ready"
Exit Sub
End If
On Error GoTo 0

Idealy I would rather not use the "testFile" I would prefer to just test to see if the folder existed, "destDrive & "xDeletedStuff"

View 1 Replies View Related

VB Code To Change DIR Drive

Oct 24, 2007

I have part of the code below and need to modify it so that others who only have C: instead of D: to use it

Filename = "D:TempBudgetMonthly.xls"

FileExists = (Dir(Filename) "")
If FileExists = False Then
msg = "The data file Monthly.xls does not exist !! Load the required file and run the report again !"

If MsgBox(msg, vbExclamation + vbOKCancel) = vbOK Then
End If
Exit Sub
End If

I need code to replace all D: to C: for the entire PROJECT not MODULE.

View 9 Replies View Related

How Do I Pull Drive Data

Apr 9, 2009

I am trying to get a excel to list all the file names in a drive along with date last modified, author and file size. I have got the following bit of code to pull back the file names, but i am struggling to find anything that will pull back the other data, I think its something to do with the DIR function, but im not sure........

Range("B1").Select
D = ActiveCell
Cells(2, 1) = "Filenames"
r = 3
f = Dir(D, 7)
Do While f ""
Cells(r, 1) = f
r = r + 1
f = Dir
Loop
End Sub

where "B1" is the file path of the drive

View 9 Replies View Related

Save To Unmapped Drive

Jan 10, 2007

I want to create and add-in that will allow a user to select a file (using the in built dialog boxes), the file will then be copied across the network to another server to which the user doesn't have access - I do have access so would hard code in the appropriate username and password in to the script.

The way I had done this before was to look through the users mapped drive to find a free one, map the network drive connecting as myself, save the file and then disconnect the drive.

I am able to map and disconnect the drive, but can't work out how to find an empty drive to use (thus preventing me from overwriting any mappings they may already have).

View 3 Replies View Related

Drive Serial Appear In A Cell?

Mar 22, 2007

I was just viewing the VBA to "get a hard drive serial" and would like to know how I can make the serial appear in a cell?

Sub SerialNumber()
Dim oFSO As Object
Dim drive As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set drive = oFSO.GetDrive("C:")
MsgBox drive.SerialNumber
Set oFSO = Nothing
Set drive = Nothing
'release memory
End Sub

View 3 Replies View Related

Choose Drive & Folder

Feb 22, 2008

I am trying to get the user to choose which disc the file structure should be stored in. Is it posible to get a dialog box which contains all the disc drives? I tried using the GetOpenFileDialog, but it seems I must choose a file. I must only choose Disc Drive.

View 5 Replies View Related

How To Read All The Filenames From Local Drive ?

Dec 3, 2008

I need to know how to read a filename from my local drive c: ? for example in my local drive i have some 100 files, i need to pick there filename, date and time stamp .. etc.

View 7 Replies View Related

Redirect A Macro If Drive Not Found

Apr 2, 2009

I need to code an option to overcome the fact that 1 workstation sees all drive letters differently.

I have many macro functions that may refer to "P:My documentsTrucks 2008filename"

However this workstation sees that drive as "T:Trucks 2008filename" and the macro will either not function or cannot find the location to save a copy of action in question.

Can I code an option that will "If filepath not found" ie "P:" go to "T:" etc

View 14 Replies View Related

Find File Path To USB Drive

Jun 12, 2009

I have a file which is kept on the C Drive. Each day, a different excel file is downloaded to a usb memory stick. The first file reads data from this file. The problem is, the drive letter keeps changing from E to F and the macro then crashes out.

The file on the memory stick always has the same name, so is there a macro to find the drive letter of this file and then use it in my existing macro?

View 10 Replies View Related

Saving To A Network Drive Macro...

Jan 26, 2010

I currently have the following ...

View 8 Replies View Related

Add-in Not Referenced When Workbook Run From USB Drive On Computer

Jul 10, 2012

I have an Add-In installed on multiple computers. When I update it I update them all at the same time so that everyone is on the same page. The Add-In is always in the same location for all computers.

C:- Global FilesVF MacroVF Macro Add-In.xlam

I use the Add-In to format a sheet and one of the formats is to display the "last author" & "Last Save Time" This is the code used:

Code:
Function DocProps(prop As String)
Application.Volatile
On Error GoTo err_value

[Code]....

The same situation occurs with cell Z8 as well. It appears it is looking in the wrong location. If I change the E to a C in the formula bar it fixes the issue but I cannot rely on my users to do this every time. We keep the WB's in question on an external drive and pass it around as needed. So they will run into this problem on a regular basis.

I also get a "Security Warning - Automatic update of Links has been disabled" message only when run from the USB drive.

View 2 Replies View Related

Detecting If Floppy Disk Is In Drive

Aug 11, 2007

I'm trying to make it so that a backup copy of my file is written to floppy when the file is saved (but not with SaveAs). So far, I have the following code, which if the floppy is in the drive works fine, and doesn't error out if the disk is not in the drive. But it doesn't make sure that a backup copy actually got made. How would I check to see if the disk is in the drive and loop somehow until it was so that the file got saved to floppy?

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error Resume Next
Application.DisplayAlerts = False
If Not (SaveAsUI) Then
MsgBox "Please Insert Floppy Disk in Drive A:"
ThisWorkbook.SaveCopyAs "A:" & ThisWorkbook.Name
End If
Application.DisplayAlerts = True
End Sub

View 9 Replies View Related

Macro - Search A Drive For A File

Sep 2, 2008

I want to write a macro that would go to a certain drive and search for a file?

View 9 Replies View Related

How To Open Xls File In A Network Drive

Dec 1, 2009

If you don't know what the drive letter will be, because on other people's computer it could be different than what you have.

I only have the folder address

\ROGERSDAILYREPORTSXLSDM

View 9 Replies View Related

Accommodate Different Drive Letters On Server

Dec 12, 2006

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?

View 2 Replies View Related

Hyperlink To Another File On Another Drive Fails

Jun 13, 2008

I made an excel sheet that links to other sheets on a different drive. It works while I am making it, but upon save and reopen all the hyperlinks produce this error: The address of this site is not valid. Check the address and try again.

Auto Merged Post Until 24 Hrs Passes;Figured it out. File, Properties, Summary tab, Hyperlink Box to base Drive. Auto Merged Post Until 24 Hrs Passes;Figured it out. File, Properties, Summary tab, Hyperlink Box to base Drive. Auto Merged Post Until 24 Hrs Passes;Figured it out. File, Properties, Summary tab, Hyperlink Box to base Drive. Figured it out. File, Properties, Summary tab, Hyperlink Box to base Drive.

View 2 Replies View Related

Move / Rename File On Mapped Drive?

Jul 25, 2014

I am trying to move and rename an excel template file using a macro. My code works fine when it is moving the file locally on my C: drive. However, when I try to do it on a mapped network drive I get a Path/File access error. Here is the relevant code:

[Code] ......

I tried it both ways that are commented out - both give me the error. I have permissions to read/write in all relevant folders. What am I missing here?

View 2 Replies View Related

Transferring An Image From Webcam To Hard Drive

Feb 16, 2009

Need macro that automate our QC department. What the macro does is it looks up the item number based on the barcode that the scanner reads and brings up the item number, the item description, total of units in a case, how much a single box of the item will weigh and how many units in the inner box may be sold at one time. The trouble is that not all items have an image available so that the person who is doing the checking knows what the item looks like.

There is a Logitech webcam setup to take pictures of the items. The following code allows us to import the image of the item into excel in a given cell:

View 5 Replies View Related

Custom Function To Get Drive Time Between Two Points

Sep 21, 2011

I ran across a great article on performing Drive Time Calculations between two addresses. The only problem is that I can not seem to get it to work properly. Here is a link to the article cause I want full credit to be given to the person that created it.

[URL]

Here are the steps I have taken so far.

1. Downloaded Microsoft Internet Transfer Control reference (msinet.ocx) per [URL]

2. Registered the msinet.ocx

3. Selected Microsoft Internet Transfer Control as a Reference in Visual Basic.

4. Copied the custom function for DriveTime into a module.

5. Went to sheet that contained addresses (Column A contains PointA, Column B contains PointB)

6. In C2 I entered the formula =DriveTime(A2,B2)

7. After entering the formula I get a error (#VALUE)

View 9 Replies View Related

Code To Print File Located In C Drive

Apr 14, 2013

I need code to print a file located in my C drive.

View 6 Replies View Related

VBA Download Emails From Outlook To Hard Drive

Jul 3, 2014

code they have in use for saving emails and attachments to hard drive using VBA. I have found the attached- which is close although it only [URL]downloads attachments. I would like to go through the inbox and download files received on a specific date, from the inbox subfolders to sub folders on the harddrive

View 4 Replies View Related

Pivot Table External Source Drive Changes

Mar 27, 2009

I am using pivotable with access queery as the source.

When I set it I cuse that external source browse tool, but it seems to only recognize the source if the dive is the same.
When I go downstairs to try on a users computer there dirive letter(K is different than my (H and it does not work.

View 9 Replies View Related

Searching For Afolder With Different Account Names On C: Drive

Jul 13, 2006

I have a loads of folders with different account names on my c: drive. What I want to do is put in part of the name rather than al ofl i.e. Manchester United, would just put in Manchester I have seen the * used but was not sure how this works

View 2 Replies View Related

On Time Method Fails On Network Drive

Sep 19, 2007

I am using the OnTime method to automatically send out a spreadsheet by email at a certain time. I am using Windows task scheduler to start up excel and OnTime to execute the email. I have got this to work on my local drive however I need to save the spreadsheet on a network drive. Task scheduler opens this up still, however OnTime doesn't seem to be working as I have tested it and the email doesn't get sent.

View 3 Replies View Related

Recover Corrupt Workbook On Shared Drive

Dec 7, 2007

An excel workbook we have on a shared drive is returning an error message: "The document is corrupt and cannot be opened. To try and repair it, use the Open and Repair command in the open dialog (File Menu) and select extract data when prompted. I am having trouble following those suggestions, Open an Repair doesnt' seem to be an option on the file menu. I have Excel 2003, is there any way to recover our workbook?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved