Check If Connected To Network

Jan 11, 2008

I have created an application for users that requires the user be connected to the network. I wanted to do a check to see if they are connected, and if the user is not connected they would get a message box telling them that they need to be connected to the network, then the workbook would close. Below is the code I have, but when a user is not connected they do not get my messagebox, instead they get the excel error message "excel run-time error '52': bad file name or number", and the debugger line that gets highlighted is in the function DirExists that checks the length of the directory of the file path: Len(Dir(strpath))

Option Explicit
Function DirExists(strpath As String) As Boolean
If Len(Dir(strpath)) = 0 Then 'this is where the debugger highlights
DirExists = False
Else
DirExists = True
End If
End Function

Private Sub Workbook_Open()
Dim strpath As String
Dim strfile, strfile2 As String
strpath = "\n530fs1PCLFileSharespcl_repositPricing_ToolsPAT"
If Not DirExists(strpath) Then............................

View 2 Replies


ADVERTISEMENT

Slow Workbook When Connected To Local Network

Apr 26, 2009

I have Excel 2003 SP3 on Vista Home Basic fully patched. My code runs very slowly until I pull out the ethernet cable then it runs quickly.

View 9 Replies View Related

Check If Speadsheet Already Open In Network Drive By Another User?

Jul 28, 2012

I want a simple VBA code that when run will check if a particular spreadsheet that exists on a Network Drive is already open or not by another user. Imagine there are 3 users A, B & C

The network path for example is : S:Department1TeamAConsolidated Report"

The spreadheet name is : Consolidated Database.xls

If the spreadheet that is on S:Department1TeamAConsolidated ReportConsolidated Database.xls is already open by User A then User B should get a message that "File is already open"

I have the below code which I got from a website which I kind of tweaked but it doesnt work.

Dim WbookCheck As Workbook
On Error Resume Next
Set WbookCheck = Workbooks("Consolidated Database.xls ")[code]......

View 5 Replies View Related

Sum Up Numbers Connected To Repeating Names?

Nov 3, 2008

I have an excel assignment that has about 4000 orders for wood. I am suposed to find the company that ordered the most wood and of what kind. I am really at a loss for how to do this and have combed over my book quite afew times trying to figure it out. However it has little if any excel info and nor does the ** that came with it outside of how to install data analysis tools. I figure I need to find a way to get excel to combine the numbers together for orders from the same company but after trying for afew hours I have gotten no where.

View 3 Replies View Related

Selective Columns In Connected Workbooks

Mar 20, 2014

I have a workbook with several columns, some of which are for internal company use only.

Sometimes we need to send an updated list to business partners, but they don't need all columns.

Is it possible to make another workbook which takes only specific columns, and excludes the stray info at the bottom of the original workbook? See examples.

Alternatively: Would it be simpler to make an extra sheet in the original workbook, and somehow choose "Safe only this sheet to a new document" whenever someone requests the list?

View 1 Replies View Related

Macros Connected To Hidden Sheet

Feb 14, 2014

I have a macro which copy text from a sheet (sheet-1) and paste it into another sheet.

I want sheet-1 to be hidden, or even better, very-hidden, but when I hide sheet-1 the macro run fails. Respons Run-time error '1004'...

Is it a solution around this 'problem' or does sheet-1 always has to be visible ?

View 3 Replies View Related

Calculate A Lot Of Averages Of Non-connected Values

Feb 20, 2008

Situation: I need to calculate a lot of averages of non-connected values. That is, they are separated by several rows (which also contain values). So far, I use the code-sample below (just to illustrate), which is not really elegant. Unfortunately, it seems that this technique comes to its limits when a high number of different non-connected values are combined into one string and get assigned to a formula- range (last line of code), which is where the program stops.

My question is: Is there a nice way to solve this? A way, which is not limited by the amount of data processed? The only way I could think of, would include a UDF, where a sum, sums all values up and then devides by the number of added sums ... but this would be relatively slow, and I have an awful lot of values to be averaged (100 sets * 6 rows * 200 values = 120.000 calculation- steps), as well as STDEV and a Standard Error of Mean (SEM) to calculate. Is there a better alternative?

Const intCells=9 'actually, this is no constant but a variable
Const i=4 'actually, this is no constant, but a nested for- loop-value
Const intLinesInBetween = 12 ' amount of lines, which separate my values
Dim j As Integer 'simple counter, runs through all cells
Dim rngUpperRow As Range 'Range of the upper row = normalized time vector
Dim rngCurrentRowAvg As Range 'current row into which avg formulas are inserted
Dim intCells As Integer ' amount of experiments in range............

View 4 Replies View Related

Boolean Function To Return Whether PC Is Connected To Internet?

Jun 6, 2013

I want a boolean function to return whether the PC is connected to the Internet. How to start creating this.

Reason:

I have code that checks an online database and downloads data after the user presses a button.If the host computer is not currently connected to the net, I would like to display a message of my choice instead of trying to run the code.To determine whether to run my message or not, I need a function that will return TRUE/FALSE if the host PC is net connected or not.

View 11 Replies View Related

Online Status - Conditional Cell (Connected / Unconnected)

Mar 4, 2012

I am seeking some code that will check that the PC / Laptop has an online ethernet connection via it's NIC (Network interface card). I want it to output to the spread sheet to a Conditional cell (Connected / unconnected).

View 2 Replies View Related

Web Query Stay Connected And Get Live Data From A Site?

May 7, 2009

Is there any way to have a web query stay connected and get live data from a site while still being able to use excel at the same time?

Basically the site has information that changes by the second and i need to keep a running record of it, and when it hits the variables needed i want to be able to trigger a set of code.

View 9 Replies View Related

Extract Scatter Plot With Connected By Smooth Lines Points

Jul 25, 2012

I have a couple of points, and when i do a scatter plot with connected by smooth line plot, it seems like excel does a bezier splines interpolation. I am wondering am i able to extract the data plots from the data chart?

for example if i have

X - Y
0 - 5
180 - 0
360 - 5

I would like to have all datas of Y from X (0 - 360 degree every degree).

View 9 Replies View Related

Excel 2007 :: Viewing SQL Statements Without Being Connected External Date Source

Jun 3, 2012

I now have XL 2007 but no longer work at the same place so do not have access to the external data source. I would like to view the SQL statements that I wrote back then but keep getting error that I am not connected to external data source and so cannot see my sql statements. I have MS Query 2007.

View 1 Replies View Related

Excel 2010 :: Formula To Indicate Alphabetical Data Connected To Numeric Data

Jan 8, 2014

I have a question about using conditional formatting in excel (2010); I made a table with the following columns:

"Supplier Name" "Supplier Lead Time" "Internal Lead Time" "Total Lead Time". I made two different scenarios to show different supplier lead times and different internal lead times, and used the minimum function in the "Total Lead Time" column to find the smallest total lead time to select the best supplier.

The last thing I would want to do with this set of data, is plug in a formula that would somehow indicate which supplier corresponds to the shortest total lead time (which supplier has the smallest supplier lead time). I'd like to be able to use a formula that enters the name of the supplier in a designated cell, which I could indicate as the "Preferred Supplier" cell. If this is not possible perhaps there is a way to highlight the supplier's name with conditional formatting?

View 2 Replies View Related

How To Make Macro To Lock Certain Cells Connected To Another Cells Value Then Copy Daily

Mar 29, 2014

am making Excel for private use, i need the following makro to be active, here is the idea because i didnt yet work with makros at all:

If A1 = False
then Range B1:D1 will be locked cells

If A1 = True
then Range B1:D1 will be unlocked cells

Those rules apply to 1 day in the year.

the range A1:D1 will be copied about 400 so the makro should be active to each day separatly.

Check the picture attached for example of one day

View 1 Replies View Related

Increasing A Value In A Cell By Adding A New Number To A Connected Cell?

Mar 28, 2009

First I would like to say that I am not English nor very good to explain myself so hope the title is according to the forums rules. Now to my problem

I would like to to put in for instance the number 100 in cell A and then the number should appear in cell B. I would like to remove the number in cell A without the number in cell B to dissapear. Then add for instance 50 in cell A to get the number in cell B to add up to 150 and so on. How can I do this? I would like to add that cell B is already connected to a different cell. And I am using Vista.

View 5 Replies View Related

Network Print Is Required

Feb 23, 2014

I recorded a print macro which prints to my default printer, others will be using this spreadsheet so I really need it to print to the same network printer. The printer address and name is: ironyan-fileBI44

How do I incorporate this into my code?

[Code] .....

View 7 Replies View Related

Working With PC Network Names?

Jun 3, 2014

Is it possible to retrieve the network name of the local workstation and if so how?

View 2 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

Changing Network Printers

Apr 15, 2009

I have a command button in a spreadsheet with the following code attached to it

View 4 Replies View Related

VBA - Opening A Workbook On A Network

Sep 29, 2009

As above i have a macro which opens a workbook which is on a network drive. This works fine for my multiple users...however i have discovered that if they do not have the drived mapped with the same drive letter at the start...it will throw up an error advsing that the file does not exist. Is there any way to by pass this.

Ex - "TestFile.xls"

File is stored in "E:NetworkTeam1Testfile.xls"

However, some users have access to this file and it is mapped as E:, but some users have been mapped as F: The advisors who have been mapped as F: cannot access the file. Is the VBA/Macro smart enough to bypass the drive letter and just search the rest of the past...NetworkTeam1Testfile.xls".

View 2 Replies View Related

How To Get To A Computer On Our Network Using Code

Jan 29, 2007

I have code below that works well most of the time. One of the cases below will not work. It insists on requiring a name and password.

(note: it is the only Windows 2000 operating systems)

I want to enter this in my case line to automatically add the username and password.

Let's say the username is: "dave" and the password is: "happy"

How can I add this to this part of the code?

Case "DJ"
strfilename = "\DAVEJONESDavesProposals" & strfilename

Sub Save_and_SaveSalesman()

Dim strPath As String, strPath2 As String, CurrPath As String

Dim WB1 As Workbook
Dim WB2 As Workbook

View 9 Replies View Related

How Can I Identify A User Over A Network

Apr 28, 2008

I have written a function (with the help of the good folk on this wonderful message board) that is able to check whether a given spreadsheet is currently being used by someone at my work. There are potentially multiple users for the workbooks that my system needs to access. FYI, I work in a bank so we have a pretty good network.

The code for my function, as well as the TestOpen(-) function that it uses, is below.

Ideally, if a workbook my system needs is currently being used on someone else's computer (Case=1 in Select statement, then Err0) I would like to be able to have a userID returned to me so that I know who I need to call to shut the model.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Function Open_Selected_Drone__EXEC(fs, fileLocation, fileToOpen, testOnly)
Application.ScreenUpdating = False
myName = ActiveWorkbook.Name

Application.StatusBar = "Checking availability of " & fileToOpen
iOpen = TestOpen(fileLocation & "" & fileToOpen)

Select Case iOpen

Case 0: ' the file has been found and is not in use
rv = "not in use"
If Not testOnly Then Workbooks.Open Filename:=fileLocation & fileToOpen, WriteResPassword:="j"

The old version of this message board used to have an "insert code" button. I cant see it anymore. Am I simply meant to paste code into this message box now?

View 9 Replies View Related

Call A Sub From An Xls File On The Network

Oct 1, 2008

I'm trying to call a sub in an exce. file that resides on our network drive so that multiple users can access the programs that I develop and I can get VBA to open the file but I can't get it to open the sub titled "DCU". I keep getting the following error.


Cannot run the macro DCU. The macro may not be available in this workbook or all macros may be disabled.

Here is my code that errors.

Option Explicit
Sub DESCRIPTION_CLEANER_UPPER()
Application.Visible = True
Workbooks.Open Filename:= _
"\Cansvp01grp_01fCommonCommon-PartsPrcngMacrosMacros.xls"
Application.Run "DCU"
End Sub

View 9 Replies View Related

Active Network Printer

Oct 30, 2008

Is there a way to test for an active default network printer?

In my module the code sets the paper size and a few other printer settings, if my default network printer is down or offline the code fails.

If I could test for active default printer I could remove this error.

View 9 Replies View Related

Use Network Id To Unprotect Sheet

Jun 1, 2006

We have created a spreadsheet that needs to be protected as it is viewed by several users. We would like, if possible, to update this daily with as little human intervention as possible.

Can we use VBE and the on worksheet open event to unlock the password protection, update the sheet and then lock it again? I know that you can read who opens the sheet using code similar to the following but don't know whether the password protection can be "unlocked" utilising this method.

View 6 Replies View Related

Template Read Only On Network

Jan 3, 2007

I have 2 workbooks, one containing one worksheet that acts as a Template a second that has some code attached to a button that uses the Template to create new worksheets based on the Template. The problem I have is that when I run the code over a network I always get a read only worksheet created. I need it to be readwrite. I have used sharing on the Folder where the 2 workbooks are located so it accessable over a network. There is no problem when I run the code on a standalone machine.

Private Sub CommandButton1_Click()
Dim tClient
Dim tAddress
Dim tPhone
Dim tItem
Dim cOriginalLoan
Dim cAgreedInst
tClient = Client
tAddress = Address
tPhone = Phone
tItem = Itm
cOriginalLoan = loan
cAgreedInst = Inst
Sheets("swbrd").Select
PathName = Range("A196").Value 'Here is where the full path to the Template is found.................

View 3 Replies View Related

Macro Does Not Run On Different Computer In Same Network

Jan 20, 2007

I wrote a macro that runs perfect when started from my pc, but if started from a different ps which is logged into the same network it doesn't run, also the macro is stored on the server. I have a code in the private section of the workbook:

Private Sub Workbook_Open()
Call FINAL
End Sub

then the macro 'FINAL' is stored in the 'Modules' section and starts with:

Sub FINAL()
'this part opens the Edit/Links dialog from which the user has to choose the relevant model
Dim Which_financial_model_contains_the_data As String
ActiveWorkbook.ChangeLink Name:= _
"T:DEALSSSalsa (Project)Financial modelsProject Salsa Model - BASED ON SPONSOR CASE - b - 20061214.xls" _
, NewName:= _
"Which_financial_model_contains_the_data" _
, Type:=xlExcelLinks

View 6 Replies View Related

Is File Open On Network

Jun 28, 2007

when I open a file, called "A", I want it to automatically open another file, which is shared on the network, called "B". I've tried using the "IsFileOpen" routine and a few other sets of code that I've found on the internet but none of them solve my problem.

If "B" isn't open on any computer and I open "A", there is no problem, and if "B" is already open on my computer when I open "A" again, there is no problem, but if "B" isn't open on my computer and is open on somebody else computer, "B" won't open on mine when I open "A", the code assumes that because "B" is open on someone elses computer, "B" is already open on mine.

View 9 Replies View Related

Install Network Printer Via VBA

Jul 26, 2007

I have a new workbook that needs to be printed to a specific printer regardless of who the user is. I am happy with the method used for doing this using the PrintOut function, but am trying to work out what to do in the event that the user does not have this printer installed. The logic, not in true VBA syntax, is as follows;

' Check Printer
If <This Printer> Is installed Then
Printout using <This Printer>
Else
Install <This Printer>
Printout using <This Printer>

I found a useful post about ascertaining whether or not a printer is installed, but can't find anything about actually installing a printer via VBA.

View 7 Replies View Related

Is File Open Over Network

Sep 6, 2007

I want to be able to check when workbook opens if a particular Excel file is open or not by having a true or false in a cell. This works fine if I have it open on same computer, but if I log on to another computer over a network and run same workbook it won't pick up if file open or not. I have tried various ways from this forum for file paths over network including eg. C:file or '\path on networkfile or N:pathlocfile etc. Nothing apears to work. If I check to see if file open from a different computer than the one the file is open on I receive standard message file already in use etc.

View 2 Replies View Related







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