Code Problem

MarkAndrews

Well-known Member
Joined
May 2, 2006
Messages
1,970
Office Version
  1. 2010
Platform
  1. Windows
I have a problem with the following code

I changed (On both Occurances)

ChDir "'\\hqnas01p\cac$\Management\Customer Relations\Complaint Log"

from

ChDir "'Z:\Management\Customer Relations\Complaint Log"

So I could dial straight into the server, over using a filepath & this wont work now, I could change it back - but it has all sorts of complications with certain people not having certain drives mapped to their profile

Any idea's Guys?

TIA

Code:
Sub Open_Complaint_Log()

'Script which opens the complaint log from its network location
'Link changed to CAC S: MA

Application.ScreenUpdating = False
ChDir "'\\hqnas01p\cac$\Management\Customer Relations\Complaint Log"
    Workbooks.Open Filename:= _
        "'\\hqnas01p\cac$\Management\Customer Relations\Complaint Log\Complaint Log 2006.xls"
Application.ScreenUpdating = True

End Sub
 
Mark

Preceded Date with VBA.:

Code:
.Cells(1, 3) = Format(VBA.Date, "mmmm")

For the other, are you absolutely certain you have your UNC path name correct?

Richard
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
The following has a single quote at the beginning of the file&Pathname:

Code:
Workbooks.Open Filename:= _ 
        "'\\hqnas01p\cac$\Management\Customer Relations\Complaint Log\Complaint Log 2006.xls"

Richard

Thanks Richard :) , this worked 2nd time around - Strange :unsure:

removed '
 
Upvote 0
Mark

Preceded Date with VBA.:

Code:
.Cells(1, 3) = Format(VBA.Date, "mmmm")

For the other, are you absolutely certain you have your UNC path name correct?

Richard

Thanks Richard, I just restored the file back to when this code was working - although nothing has changed in the code

Thanks as ever :biggrin:
 
Upvote 0
Mark

Preceded Date with VBA.:

Code:
.Cells(1, 3) = Format(VBA.Date, "mmmm")

For the other, are you absolutely certain you have your UNC path name correct?

Richard

This still brings back the same Error Richard?

Puzzling :unsure:
 
Upvote 0
Code:
Private Sub workbook_open() 

Application.ScreenUpdating = False 
Application.StatusBar = "Development & Design by Mark Andrews" 
Sheets("Criteria Selection & Pivots").Select 
MsgBox "Welcome " & Application.UserName 
MsgBox ("To recalculate this document, please change the dates in cells A2 & B2, then click 'Refresh Entire Document'") 
Range("A2").Select 
With Sheets("Productivity") 
    .Cells(1, 3) = VBA.Format(Date, "mmmm")     
    .Cells(1, 4) = "=DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0))" 
    .Cells(1, 4) = Evaluate("=DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,0))") 
    End With 
Application.ScreenUpdating = True 

End Sub
 
Upvote 0
Mark

Check under Tools>References... in the VBA Editor.

Anything marked MISSING?
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top