Error 424 - Extracting Filename / Last Author?

Apr 3, 2014

I have the following code which successfully opens the specified workbook and copies the values to the active workbook, but then gives an error on the line of extracting filename, and when extracting last author. However, the code works fine if I use 'getopenfilename'.

[Code]......

View 8 Replies


ADVERTISEMENT

Extracting Data From File In Directory And Extracting Filename

Mar 20, 2014

I have a directory folder with an active workbook and another workbook id like to copy data from. The Following macro opens up a file in the same directory, copies some data and pastes it in the active workbook. However with this code I have to specify the filename, 'Data.xlsm' in the example code. I would like it to copy data from the only other workbook in the current directory WITHOUT having to specify the name in the code, so just opening it up no matter what filename it has.

In addition I would like to extract the filename from the workbook im copying data from and paste it into the activewoorkbook in sheet 1 Cell A1. I had a look at getopenfilename function but cant seem to make it work for my purpose.

View 4 Replies View Related

Extracting Current Worksheet's Filename

Feb 9, 2007

how to extract the current/active worksheet's file's name using VBA code. Let's say I have a an excel file with the name "Test.xls" Which function do I use to return Test (with or without the extension)?

View 4 Replies View Related

Error-prooofing Get Open Filename

Jan 23, 2008

I am trying to skip over any errors associated with the GetOpenFilename window, specifically where the Cancel button is selected, or no files selected. In the code below, I get an error "Object required" at the line shown every time this is run, even when the file path is valid and correct, and then the msgbox appears as a result of the On Error statement .

myExcelFilePath is dim Variant

On Error Resume Next
myExcelFilePath = Application.GetOpenFilename("Excel files (*.xls), *.xls", , "locate Report.xls....")
If myExcelFilePath Is Empty Or myExcelFilePath Is Null Then

View 9 Replies View Related

Error 53 At Open Filename For Output

Jun 2, 2009

I try to make a macro for saving an Excel sheet to a .CSV file with "@" as delimiter.

At the line "Open fname For Output As #fnum", the Error 53, "no file found" occurs.

The Excel-help is saying that if the file is not present, a new file will be made.

This error occurs now and then, How to proceed?

Full macro:

Sub SaveAsCSV()
Path = "O:actueel"
Fname1 = Path & Range("E2").Value & ".csv"
fname = Application.GetSaveAsFilename(Fname1, "CSV bestand (*.csv), *.csv", , "")
If fname = False Then
MsgBox "Macro Geannuleerd"
Exit Sub
End If

View 9 Replies View Related

Error Extracting First Name From Cell If Only 1 Name

Jan 1, 2014

I'm trying to extract the first name from each row in column a using:

Formula:

A B
Joe Smith Joe
Julie Smith Julie
Julie #VALUE!

If the cell does not have 2 names it's giving me an error.

View 10 Replies View Related

Error Extracting Pivottable Data With VBA

Mar 29, 2007

I try to extract datas from a pivottable (so one data source) which could change.

The items of one field are changing (given by the user through Inputbox): "batch"

The items of the second field ("type plate") are at each time visible (the macro make them visible to have the complete information concerning the "batch")

So I want to extract values and labels from one particular pivottable (the one I display), selecting several batches. But the problem is that some of the items have no value, so disapear fron the table) even if they are visible. As I extract the value on each item (see code below) I get an error message saying "runtime error 1004 application-defined" when the macro read "valeur".

Dim pt1 As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Dim pj As PivotItem
Dim i As Double
Dim valeur As String

I tried to go through this problem using "on error goto solution" but it works only one time, and after same error message

How coud I avoid to calculate "valeur" with the Items (pi) not displayed ?

View 9 Replies View Related

Password Removal For Non-Author?

Jul 3, 2013

I have some password protected excel worksheets that required editing as they are from earlier versions, an earlier time and all need to be updated. This would be fine if it was myself who actually made the worksheets, but the person who did retired a couple of years ago and has dropped off the map (no contact details etc).

I know how to remove passwords, when I was the one who set them. The big problem here is, they are all macro enabled and for some reason the free down load password removal applications do not unlock worksheets that are macro enabled.

View 1 Replies View Related

List The Author Of A File

Mar 20, 2007

I have around 1000 files in a folder saved by different users at my company. I would like to be able to examine each file using VBA and write to a spreadsheet the username of the person who created and / or last saved that file. I can't find any reference online or in VBA help about this,

View 9 Replies View Related

Type Mismatch Error - Extracting Number Macro

Jul 14, 2014

"Type Mismatch error" in the macro below. I am trying to implement logic, where if value in column F, equals "1ma+89", then extract 89 only in column G. I also have other values in column F, where I have set specific rules for them, to extract numbers.

I have attached a worksheet with example data and highlighted red cells, represent incorrect output from the macro.

test2_14July.xlsm

View 4 Replies View Related

Change Author Of Shared Excel?

May 25, 2013

can we change the author of shared excel and will this allow the changed author to make changes in no. of days to track history

View 6 Replies View Related

Adding Author To Indexing File

Jul 2, 2014

I'm trying to get a document together that will spit out an index of all the files in a folder/subfolder with various attributes like title name/ hyperlink to the file/ type/ etc. How to add a function that will create a column/pull data for the author of the files I am indexing.

Code:
Public fPath As String
Public IsSubFolder As Boolean
Public iRow As Long
Public FSO As Scripting.FileSystemObject
Public SourceFolder As Scripting.folder, SubFolder As Scripting.folder
Public FileItem As Scripting.File
Public IsFileTypeExists As Boolean

[Code] ...........

How to get a column that lists the author of the document.

View 2 Replies View Related

Insert Author And Date In Footer Of Workbook

Oct 31, 2013

I have a PO Template which I wish auto insert below information in the footer.

a) User Name
b) Create date
c) Last modify user
d) Last modify date
e) Print date
f) No of pages (Say Page: 1 of 3)

When the PO is issued, the softcopy will be saved in a Server.

In certain circumstance, the existing PO will required to be revised. Most cases, it might not be the same user who created this.

For tracking on identity, I wish the last modify user, date and print date to be captured and printed in the footer note?

Whether I can lock the footer information as well? So that all user will not be able to edit these information?

View 2 Replies View Related

Excel 2007 :: How To Lock Author Of The Worksheet

Sep 13, 2009

It is possible to lock the Author of the Worksheet in File --> Properties --> Summary Tab..?

I am using Excel 2003 & 2007..

View 8 Replies View Related

Adding Author Column To Excel Indexing Sheet

Jul 2, 2014

I'm trying to get a document together that will spit out an index of all the files in a folder/subfolder with various attributes like title name/ hyperlink to the file/ type/ etc. How to add a function that will create a column/pull data for the author of the files I am indexing.

[Code] .....

Here's the website: [URL] .....

How to get a column that lists the author of the document.

View 3 Replies View Related

Amending The Filename In Cell("filename")

Jul 7, 2006

I am trying to display the Filename in a cell on my worksheet. However, when I enter the =Cell("filename"), it provides the full path (C:/Documents......Cost Summary.xls) How can I display only the filename without the path?

View 3 Replies View Related

Get Date From The Filename

Jun 18, 2014

I have a filename 'filename-12-14-2014' where i need to extract date information from the filename and insert a new heading in the file 'date' in the first column and write the extracted date till the end (until data exists). I can write the new column name but i could not write date in all the fields. code i wrote is below

this is for extracting date from the filename. the 4th lines throws me the error?

(1) LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
(2) With Range("A2:A" & LastRow)
(3) x = Split(s, "- ", 2)
(4) .Value = Left(Mid(x(1), InStr(x(1), "-") + 1), InStr(Mid(x(1), InStr(x(1), "-") + 1), ".") - 1)
(5) .NumberFormat = "mm/dd/yy"

for adding the date in the first column. This works fine

Columns("A:A").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A1").Select
ActiveCell.FormulaR1C1 = "Date"
s = ActiveWorkbook.Name
Range("A2").Select

View 7 Replies View Related

Extract Filename Using VBA

Jul 21, 2014

I have excelfilename starts like abc - usa sales- 1-1-2014. have to extract usa from the filename and insert as a column in excel with columnname 'country'.

View 1 Replies View Related

Add Date To Filename

Jun 3, 2009

I picked up a bit of code to create a CSV with a | delimiter. so that I could save the file with a date added onto the filename. i.e. myfile060309.csv.

View 4 Replies View Related

Save The Filename

Sep 11, 2009

I have a problem with the following code

View 2 Replies View Related

Getting Date From Filename

Nov 13, 2013

I have filename as filenamex - filenamey-11-13-2013. I want to get only the date from the filename.

View 3 Replies View Related

Use ComboBox Value As Filename

Feb 4, 2008

I'm trying to use the value of a combo box as the filename when saving as. The code i have so far is:

Dim fName As String

fName = FileNameTXBX.Value

ActiveWorkbook.SaveAs Filename:=fName, FileFormat:=xlCSV, _
CreateBackup:=False

View 9 Replies View Related

Add The Date To A Filename

Aug 28, 2009

I need to add a date to the existing filename it is being saved as. Currenntly the filename is saved as follows:

x = Cells(Rows.Count, 1).End(xlUp).Row
For a = 2 To x
y = Cells(a, 12)
Workbooks.Add ("C:Documents and SettingsDesktopTemplate.xlsx")
ActiveWorkbook.SaveAs FileName:=y
Next a

I want the filename to stay the same as above but add "-r-"a number entered into a textbox representing the revision and then the date the file was saved in the following format dd/mm/yy.

The form containing the text box has been scripted and works fine. The string entered in the textbox currently resides in the Active sheet being saved in cell "E4".

Below is a completed Filename. Note the RED is what i need to add.

2138-035-PW-COM01-RCS-001-r-1-28/Aug/09

View 9 Replies View Related

Filename As Cell Value

Oct 11, 2009

Is there a way to take filename and place value in a cell

View 9 Replies View Related

Filename Retriever

Jun 28, 2006

I've made a simple filename retriever. Click on the button to list the filenames under the specified path. I would like it to go deeper into subfolders. At the moment it only drills down one level. Need to make it able to drill down to all the levels present and list out the filenames.

View 4 Replies View Related

Get Filename With Formula

Aug 7, 2008

I am trying to use the formula below to get the filename of the spreadsheet, it seems to work fine but when you open a second sheet the first sheet will pick up the name of the second. =MID(CELL("filename"), FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1). These spreadsheets will then be uploaded to another application and having 2 with the same name could cause issues. Obviously the answer is to only open one at a time, but this is always subject to human error!

View 3 Replies View Related

Extract Date From Filename For New Tab

May 9, 2014

Every week we produce a report that has the filename: Master_BER_Pending Revokes Report_YYYY-MM-DD.xlsm

Some of the information from this workbook needs to be pasted into a new tab on a different workbook. The new tabs naming convention is simply "DD MM". Currently I've got a command prop that asks the user to enter it in manually. See below

VB:

Dim newsh As String
newsh = InputBox(Prompt:="Enter new tab name", Title:="Tab Name", Default:="e.g. '05 05'")
Sheets.Add After:=Sheets(Sheets.Count)
Sheets(Sheets.Count).Select
ActiveSheet.Name = newsh

The user gets the information for the month and day from the filename of the report that was produced. What I need is the DD and MM to be extracted from the filename and used to name the new sheet.

View 6 Replies View Related

Alternatives To CELL (filename)

Apr 7, 2009

CELL("filename") gives you the name of the current workbook but if you switch to another workbook and then come back, the name has switched to the other workbook. You have to refresh to make the name switch back to that of the workbook you used the formula in.

What alternatives exist, short of writing some VBA, which is an option, to fetching the name of the workbook via a formula and having it remain the name of that workbook when you go away and come back again?

View 2 Replies View Related

Formula To Get The Date From Filename

Jun 25, 2009

I have a folder full of sales reports, all of the files are given a consistant format e.g. 09_wk50. I have a macro that do various calculations in each book. I now need a calculation based on the report date.

I am able to get the file name in the sheet so that I am just left with the value above (09_wk50) but I need to be able to get an actual date from that value.

I need to be able to get the monday of the week given. for the example given i would want the date 13/04/2009 because of week 50 in 2009, the 13th is the Monday.

View 4 Replies View Related

Using Variable Filename In VLOOKUP

Mar 26, 2014

I'm working on a project where I need to populate a column with vlookups taken from different workbooks, I have for the most part got it working. However currently, everytime it populates a cell it prompts the user to select the sheet from the workbook as there are two. The sheet name is always the same so I tried to add it into the code so it would avoid having to repeatedly click okay while it populated the table.

This is the original code where it asks for the user to select the sheet every time.

[Code].....

This is what is produced when it is run and the user selects the worksheet each time (which works perfectly fine):

[Code] ...........

I tried to enter the Full Costs sheet name into the code like so:

[Code] ......

However this produces the following:

[Code] .....

The issue I have found is that the square brackets that are around the filename are generated automatically, they aren’t in the actual filename and I haven’t put them in, so I am struggling to work out how to add the sheet name in where it wont be included within the square brackets, as that is what's breaking the lookup.

View 3 Replies View Related







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