Tried all of the modifications to this one code. All led to the same conclusion. I am thinking that there may be a security iusse. Is this a possibility?
Is the "Left" part of the command creating the inconsistency with some PCs? Also, would file extensions matter. For instance, the file that is being opened in the using the code is a .xlsm. Some PCs have no issue and some do.
In my initial code example was not complete. below is a much better example that includes ChDrive (Left(.DefaultFilePath, 1)).
Private Sub CommandButton119_Click()
Dim Filter As String, Title As String
Dim File As String
Dim FilterIndex As Integer
Dim Filename As Variant
Dim curWB As Workbook...
I have a code that seems to work on some PCs and not on others. All PCs are running 2007. Files can be on PC or network drives. Essentially the code error occurs at ChDrive (Left(.DefaultFilePath, 1)). I step into the code. When I get to ChDrive (Left(.DefaultFilePath, 1)), error on some...
The code now works after removing the "_".
I could use a If statement that identifies if file destWB is already open. If so, "text" alerting to this fact and move one. Currently, Excel its own alert, if selecting the "no", causes a error. Can any assistnce be provided with this?
When I modify the PasteSpeacial and run the code,
From:
Destination:= destWB.Worksheets("Resource Sheet").Range("y3:Y68").PasteSpecial xlPasteValues
To:
destWB.Worksheets("Resource Sheet").Range("y3:Y68").PasteSpecial xlPasteValues
I get the follwoing error message "Object doesen't...
I am at the end of a great code the copies from one file to another. I thought I had everthing done until I saw the need for greater buy in from users. Below is a much shorter version of what I want to do. Everything works until I get to the PasteSpecial line. The curWB has the formula in...
Tried the code below:
If destWB.Worksheets("Sheet2") is nothing then msgbox "Sheet2 does not exist"else 'do something with sheet2
end with
______________________
Received a "Subscript out of range" error message. Below is how I am using the If statement:
Private Sub...
I want to validate that "destination:=destWB.Worksheets("Sheet2").Range("E5")" is the correct worksheet.
How do I write an if statement to alert that the active workbook.worksheets does not match the destination.
________________________
Below is my attempt:
If Destination = False Then...
I need assistance with a print code.
What I want to select columns and hide those columns. Then file print. When the print dialog box appears, I want to have the option to select From/To and number of copies. Then I need to option to preview or just print. If preview is chosen, I need the...
I want to copy from one xls and paste to another xls to another. To get there, I need to identify the two files and sheets. How do I identify the current xls that is open as well as indentfy the xls that I open to paste into? Additionally, how do I ensure the right sheets for both files are...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.