Excel 2013 :: Set Photo Path As Variable?
Mar 31, 2014
I have a macro that inserts a photo via a photo path that has been set as an object variable. This macro has always worked for me in Excel 2003 but after updating to Excel 2013, the macro gives me a "runtime error 1004 - unable to get the insert property of the picture class". When I debug, Excel crashes.
The macro is designed to loop through up to nine fields (in 9 adjacent columns) and find a photo path for a picture, insert the picture, and print that page, then go to the next column, get the photo path and insert that picture and repeat. The initial part of the macro is as follows. The PhotoID as Object seems to be what no longer works...
I do not care if the inserted photos are maintained in the file when it is not connected to the3 drive hosting the photos, only that I can print them when the drive is available.
Sub PrintPDFImpSums()[INDENT][INDENT]Dim PageNo
Dim RangePrint As Range
Dim Photo As Picture
[Code]....
View 1 Replies
ADVERTISEMENT
Jun 16, 2014
I have data in E6-E67 on Sheet 1. Based on the date in A2 on that sheet, I need to paste to a column in Sheet 2. In excel, I am able to get the cell location through vlookup and get the correct column number/cell reference. When it gets to the paste location, I am stumped on how to format that line of code? Do I need sometime of variable? I tried to use the address/lookup code but it does not work.
I have excel 2013.
View 4 Replies
View Related
Jan 24, 2013
Is it possible to put a picture in excel with transparent "cells" like the attached. Where I could type in the actual cell in the transparent (white blocks) part of the photo?
View 4 Replies
View Related
Apr 20, 2014
Excel 2010, Windows 8.1. I want to retrieve a photo from a folder and paste it into a cell. I have the paste and format process figured out but I'm having trouble putting the file path together to retrieve the photo. If I use the full path, the statement below retrieves "IMAG1234.jpg" and puts it where I want it.
ActSheet.Pictures.Insert("C:UsersEljafeDocuments1-QCReport_PhotosIMAG1234.jpg").Select
But if I have a different photo file name as a string in a cell (e.g. "IMAG5678.jpg") what is the syntax to attach it to the file path? i.e
ActSheet.Pictures.Insert("C:UsersEljafeDocuments1-QCReport_Photos") & "IMAG5678.jpg".Select '(which of course doesn't work)
So, I have a path but I want to attach different photo number to the path from a sting in a cell.
View 2 Replies
View Related
Jun 25, 2014
How could i get the below code to work with a variable as the file name?
Or could I use something like "thisfile" to determine where to import to.
[Code] .....
View 5 Replies
View Related
Feb 8, 2012
I am using a script within excel as part of this script I want create a new folder to store information
Code:
ChDir "C:Documents and SettingsAdminDesktopMIKEPAYROLL2011-12"
However I want to use a variable called "NEWYEAR" which holds the 2011-12 part
For example this part stays the same
ChDir "C:Documents and SettingsAdminDesktopMIKEPAYROLL
folder 2011-12 held in variable NEWYEAR may or maynot exist.
if the folder exists I want to be able to use the folder, however if it doesn't I need to create it.
The problem is I am not sure how to incorporate the variable into the path.
View 5 Replies
View Related
Feb 4, 2007
I have been using this code to auto print a series of workbooks whose file date contains the day i want. Each if statement looks to a different folder location to find the spreadsheet with the desired date and auto prints that sheet before moving on to the next if and spreadsheet, and then finally closing. I use an input box to get the date/day variable.
The spreadsheets i auto print are in folders labeled for different months of the year, i.e. 0107, 0207 etc. I want to be able to enter the MONTH i want the spath to look for, in other words, i want to be able to input first the month, which tells the rest of the routine what folder to look for the next input, which is the date of the spreadsheet. I am flummoxed by the variable itself.
The code is below.
Public Sub Auto_Open()
Dim sCurFile As String
Dim sPath As String
fpath = InputBox("shift and day (BXX) of the month to print?", "print")
'Get the path
sPath = "k:2007207"
If sPath <> "" Then
On Error Resume Next
Application. ScreenUpdating = False
If Right(sPath, 1) <> "" Then
sPath = sPath & ""
End If
View 4 Replies
View Related
Nov 21, 2008
If I have a file open called test file, How I can find the file path of the file that is open and how can I store that's as a variable?
What I am doing is trying to open a file that excel closes in a save as process!
View 9 Replies
View Related
Feb 16, 2007
Private Sub cmdImport_Click()
Dim exportFile As String
exportFile = "c:jpmimportTrinity_ImpImport_" & Format( Date, "dd-mm-yy") + "_" + Format(Time, "hh:mm:ss") & ".csv"
Open exportFile For Output As #1
I put a watch on exportFile and it's correctly set to: "c:jpmimportTrinity_ImpImport_15-02-07_17:55:01.csv"
However if I try to run this I get "bad file name or numer" when I open for output - the path exists and I can write to it, so must have a fundamentally wrong approach.
View 2 Replies
View Related
Sep 15, 2006
I am having trouble getting a macro to open a specific file from an open workbook in the same folder based on the current path of the open file. The application is this... I have two files in the same folder. The first is for data entry and it contains a macro button that will open the second which is a template to which the data in the first will be copied. I can easily do this with a fixed path to the second file, however, I would like to be able to move or copy the folder containing these files to other locations or computers without having to change the path each time. I would like to base the path to the second file minus the file name on the first (already open file) path. Assuming that the first file containing the desired macro button is already open, here is one of many of my attempts...
Workbooks.Open " ActiveWorkbook.PathJob Tracker -.xls"
Assuming the second file is the active workbook, I achieved a similar path assignment when saving the file...
ActiveWorkbook.SaveAs "Application.Path/Jobs Active/" & "Job Tracker -" & Range(" '[Job Tracker -.xls]Specifications'!$A$6").Value
View 2 Replies
View Related
Dec 1, 2006
I am running a macro which ends up showing the save as dialog box. The name is correct (data) and the type is correct (XML files) but no matter what I try the file path is not right. Here is the section of
sDataFile = Application.GetSaveAsFilename("data.xml", fileFilter:="XML Files (*.xml), *.xml")
Set fs = CreateObject("Scripting.FileSystemObject")
Set js = fs.CreateTextFile(sDataFile, True, False)
Set f = fs.GetFile(sDataFile)
sFilePath = f.parentfolder & ""
Set f = Nothing
How do I set the file path? I have already seen lots of answers to this but they are based on changing the path permanently or on there being no dialog box already open. I need total automation with the user not being able to see any of the save process.
View 3 Replies
View Related
Feb 27, 2008
1 I need to open a csv file in order to use data in it at location "C:BarkingEMCIN" to input into an xls spreadsheet. I then need to use the info from the xls spreadsheet along with other info input by users to produce another .csv and it be deposited at "C:BarkingEMCOUT"
The name of the file at "C:BarkingEMCIN" will change everyday or even multiple times a day and be in the format "AVA_DA_260208_BPL_EDF_001.CSV" "AVA DA " will remain the same "260208" will be todays date the next 2 will be interchangeable depending on requirements and use BPL EDF and SSE will be interchangeable depending on requirements and 001 will be the version whcih will be changable. _ underscores will be used as seperators
They will then be save in the format "NOM_DA_260208_BPL_EDF_001.CSV" using the same prinipals as before but automatically saving as the next available when needed with a prompt to tell the user what it will be
View 5 Replies
View Related
Jan 29, 2009
I am looking for macro that when run, will open a file explorer window and prompt the user to select a folder and file where they have data stored. Then I need it to be stored as a variable and used as a part of a "Workbook.Open Filename" command.
The reason for this is that, I have a huge formatting marco stored within a workbook. When a user extracts a report from SAP, I want the workbook to grab the file that is extracted, open it and import all of the data in order to be formatted.
View 6 Replies
View Related
Feb 14, 2010
I found this code and maybe I'm almost there. I need to get the value of the Environment variable called HOME if it exists.
These macros collect all the environemnt variabes into an array and then show them in a messabe box.
View 3 Replies
View Related
Apr 15, 2014
Using EXcel 2013, Windows 8
I have an Excel worksheet with one column being e-mail addresses. Other columns are Christian names, etc
Ideally can I create a full Mail merge with Outlook using whatever data I want. But probably just e-mail address and Christian name?
Otherwise be able to send one e-mail to all the e-mail addresses, without a major re-type.
View 2 Replies
View Related
May 26, 2014
I am working on a VBA code I found online. That will download a photo from a designated URL and input the photo in to a cell.
I am attaching a spreadsheet which has a URL in Colum C2 I would like to download the photo via the macro and input the photo based on that URL in to Colum b2.
I was using the following code
[Code] .....
However I am getting a weird error result.
View 1 Replies
View Related
Feb 26, 2009
Can someone do me a favor and explain this string of code to me?
View 12 Replies
View Related
Feb 20, 2010
I'm trying to find some simple code that would that would allow me to select a picture from the picture dialog and insert it to active cell at a small size, like 2 1/2 by 2 inches
View 4 Replies
View Related
Jun 29, 2009
I have Office 2007 and i use this code on my word.docm to insert selected photos. the problem I'm having is that it insert photo at top of page. can additional code be added so that it will insert photo in same table as command button. and in front of button, so that it will hide button
Private Sub CommandButton1_Click()
Dim sFileName As String
Dim ilImage As InlineShape
With Dialogs(wdDialogInsertPicture)
.Display
If .Name "" Then
sFileName = .Name
Set ilImage = ThisDocument.InlineShapes.AddPicture(sFileName, , True)
With ilImage
'set any additional properties such as left, top, etc., here
End with
Else
Exit Sub
End If
End With
End Sub
View 9 Replies
View Related
Mar 4, 2013
is it possible to configure Excel in order to save the Hyperlink path for a file with absolute path and non relative?
I notice that the hyperlink is ....pdf ry.pdf
if I change the position of the file excel there is a problem!
I would like to save es. d:invoichepdf ry.pdf
View 1 Replies
View Related
Feb 11, 2014
I am using an XY scatter chart that displays the planned path and an actual path as I go. The planned path is set up in 100' increments and goes 12000' and actual path varies along the way.
My data that I use is the Northing (ft), Easting (ft) and Vertical Section (ft) for both the planned path and actual path.
I was wondering if there was an east way to get that information from the chart or if there is a formula that would allow me to calculate distance between the two points by using the data I use for my chart.
View 1 Replies
View Related
Oct 3, 2012
I want to run a macro to separate File Name and Path from the given complete path
For Example
Code:
In Column A : Given Complete Path " C:MainFolderRecordsSubFilesFile1Record.pdf
I need it separeted like
Code:
In Column B :File Name = Record.pdf
In Column C :File Path = C:MainFolderRecordsSubFilesFile1
Is there any way to do this through a macro
View 2 Replies
View Related
Feb 28, 2013
I Wrote a code which as intended to open each excel file in a folder and copy the data containing in it into a new sheet.
But While running the code the first excel file gets open, and an error message "Run Time Error 91-Object Variable Or With block Variable not set Error"
How to set the file which got opened from the folder to wbk variable.
Code:
Sub dataintoonesheet()
Dim i As Integer
Dim jk As Integer
Dim j As Integer
Dim rowstart As Integer
rowstart = 3
[Code] .......
View 9 Replies
View Related
Jul 2, 2014
Working in Excel 2013......... I take 3 readings per day, I would like to see the daily average per day
In cases where the data is blank or "0", just average the 2 readings.
Sample Data
Date Speed
6/1/20142560
6/1/20142550
6/1/20142558
6/2/20142554
6/2/20142537
6/2/20142532
[Code] ..........
View 4 Replies
View Related
Nov 28, 2013
My and a work college needed to combine our separate excel worksheets into a single document.
Office 2013 didn't have a function to "import sheet from file" so we used open office to import my .xlsx worksheets.
After we finished importing we exported the final workbook as .xls (so I could open it).
After opening the workbook on my pc (excel 2013) i notice some of the sheets no longer have column headers, but the row headings still exists. (No ABCD, only 1234)
Also I am unable to use features such as "Freeze Pane"
I suspect this was caused by importing and exporting through open office?
View 4 Replies
View Related
Dec 18, 2013
Tried a macro with no luck, I want to save workbook to PDF and have it named by the value in A3. I want the Dialog box to pop up so I pick the folder?
View 6 Replies
View Related
Jun 24, 2014
I installed excel 2013, but I don't find the (VBA) buttons on the ribbon, since.
Is there a need to install an add in / or activate an add in?
The macro's are on the ribbon on the tab VIEW.
I expect to find the buttons on that place also.
View 3 Replies
View Related
Aug 21, 2014
How to activate Developer Tab in Excel 2013.
View 1 Replies
View Related
May 6, 2013
I'd like to record a macro that allows me to take the current file "file.csv" and save it as "file.xlsx"
I can't get the variable right (just messing around in VBA to have it get the file name and save it as a different format (csv to xlsx)
I've tried:
Function GetFullName() As String GetFullName = ThisWorkbook.FullName End Function
View 7 Replies
View Related
May 18, 2013
I currently have a workbook that has VBA functions that calculates values by looping through large amounts of data in a few large excel sheets. I want to transfer the data from these sheets into Access and then bring data into the VBA code via an array from the data in Access rather than the array being populated from the data in excel as it currently is. How to create the connection. The access DB will be situated in a public directory on a server. How to create the connection string and then how I call the data from Access? I have just downloaded Office 2013.
View 9 Replies
View Related