Get image from Excel as shape and Save as .jpg
Hello,
I'm fairly new to ActiveX and am having a hard time doing a seemingly simple thing: getting a named image from an Excel file and saving it as a .jpg. I have seen similar things done for Excel chart objects, but as I understand it images are "shapes" in Excel and I've been unable to find the right method to extract a shape. Please, if anyone could take a look at the attached folder and tell me if I am on the right track, if there is a better way to do this, or if there is a way to do this at all, it would be helpful. Note that I don't care how efficient a strategy is developed - if I need to save to an intermediate file of another type, that's fine. The only goal is to be able to extract this image and save it with one mouse-click and no manual intervention.
Folder contains: 1 example Excel file containing the image named "Picture 1"; 1 vi showing the method I've found for exporting Excel charts as .jpg's; and 1 vi with the progress I have made so far trying to pick the image from the Excel file and save it as a .jpg.
Thanks in advance!
Megan
Solved!
Go to Solution.
Attachments:
GetExcelPicture.zip 70 KB
Hi megan,
see this link.
Hope it helps.
Mike
Similar Messages
-
mule13470
Apr 3, 2014 11:12 AM
I tried simply renaming them however it just corrupts the files when I do it like that so I need the applescript to open the files in excel and the save them as .xlsx to test I only need it one folder but if it works I'd like to be able to do it for all documents with .xlsb extentions that are in a huge folder with subfolders that contain a mix of .pdf, .docx, .xlsx and .xlsb. Please Help.
Applescript Editor, Mac OS X (10.6.8)
I have this question too (0)
Reply
Categories: Using OS X MavericksTags: mac, help, finder, excel, applescript_editor
Level 1 (0 points)
mule13470
Re: I need an applescript that opens documents in excel from a specified folder and saves them as .xlsx from their current .xlsbApr 3, 2014 11:19 AM (in response to mule13470)
In that huge folder I only need the .xlsb files opened and saved to .xlsx not the others, in case that wasn't clear above.In that huge folder I only need the .xlsb files opened and saved to .xlsx not the others, in case that wasn't clear above.
-
Rich text box used in Infopath Form not displaying option to get images from Computer
Hello,
We have used "Rich text box" in Infopath Form which is not displaying option to get images from Computer.
Options available are : From Address, From SharePoint
But if we Rich text box in list, then it works fine with "From Computer" option.
can you please help me out to get this option.
Thanks in advance.
REgards,
JayashriHi,
From your description, there is no “From Computer” option to get images with rich text box in InfoPath form.
Per my knowledge, by design there are “From Address” and “From SharePoint” options without “From Computer” option in rich text box in InfoPath form. As a workaround, you can develop a custom InfoPath Rich Text box to do it.
About developing a custom InfoPath control, I suggest you create a new thread on the forum “Visual Studio Tools for Office”, more experts will assist you with InfoPath development.
Visual Studio Tools for Office:
https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=vsto&filter=alltypes&sort=lastpostdesc
Thanks,
Dean Wang -
Error while getting image from database in SUP using ios?
Hi All,
Im developing native iOS application using sup 2.1.3 . Im getting error While retrieving image from SUP database. Here i'm trying to get image from database and show in imageView.can any one help me how to fix this issue?
In database image datatype is 'LONG Binary' .
My table Schema:
CREATE TABLE dba.ImagesTable (
RowID INT NOT NULL,
ImageName VARCHAR(20) NOT NULL,
PhotoData LONG BINARY NOT NULL,
IN SYSTEM
ALTER TABLE dba.ImagesTable
ADD CONSTRAINT ASA137 PRIMARY KEY CLUSTERED (RowID)
ALTER TABLE dba.ImagesTable
ADD CONSTRAINT ASA138 UNIQUE NONCLUSTERED (RowID)
in Xcode:
[SUP107SUP107DB synchronize];
SUP107ImagesTable *imgTable =[[SUP107ImagesTable alloc]init];
SUP107ImagesTableList *list =[SUP107ImagesTable findAll];
SUP107ImagesTable * oneRecord =[list objectAtIndex:0];
NSLog(@"rowId:%d---imageName:%@---photoData:%@---photoLenght:%d",oneRecord.rowID,oneRecord.imageName,oneRecord.photoData,oneRecord.photoDataLength);
NSData *tempData =[[NSData alloc]init];
SUPBigBinary *responseBinaryData = (SUPBigBinary *)oneRecord.photoData.value;
@try {
[responseBinaryData openForWrite:[oneRecord.photoData length]];
[responseBinaryData write:tempData];
@catch (NSException *exception) {
NSLog(@"exception: %@",[exception description]);
UIImageView *imgView =[[UIImageView alloc] initWithFrame:CGRectMake(50,50,100,100)];
[self.window addSubview:imgView];
UIImage * tempImage =[UIImage imageWithData:tempData];
imgView.image = tempImage;
[responseBinaryData close];
Error Log:
2014-04-02 18:42:15.150 SUP102[2873:70b] rowId:1---imageName:Apple---photoData:SUPBigBinary: column=c pending=1 allow_pending_state=1 table=sup107_1_0_imagestable mbo=0x0 key=(null) ---photoLenght:90656
Printing description of responseBinaryData:
<OS_dispatch_data: data[0xc891b40] = { leaf, size = 90656, buf = 0x1213a000 }>
2014-04-02 18:42:33.304 SUP102[2873:70b] -[OS_dispatch_data openForWrite:]: unrecognized selector sent to instance 0xc891b40
2014-04-02 18:42:33.305 SUP102[2873:70b] exception: -[OS_dispatch_data openForWrite:]: unrecognized selector sent to instance 0xc891b40
2014-04-02 18:42:33.305 SUP102[2873:70b] -[OS_dispatch_data close]: unrecognized selector sent to instance 0xc891b40
2014-04-02 18:42:33.306 SUP102[2873:70b] [ERROR] [AppDelegate.m:497] NSInvalidArgumentException: -[OS_dispatch_data close]: unrecognized selector sent to instance 0xc891b40This thread talks about uploading image to SAP from a IOS device,Sending Image to SAP via iOS Native app (SUP 2.1.3)
Midhun VP -
Read email from microsoft exchangeserver 2010 and save attachement
Hello,
I want to read email from microsoft exchangeserver 2010 and save attachement into a folder.I created an Java program to import attachments from a exchange server mailbox using "POP3S".It works fine when run as a java application.But when i put this inside Oracle11g R2 using load java and while executing from a procedure it gives an error at parsing message into Multipart
Error at line : Multipart mp = (Multipart)m.getContent();
Error:
Content-Type: multipart/mixed;
boundary="_002_A0C2E09A..................................."
java.lang.ClassCastException
at mailPop3.checkmail(mailPop3:71)
My Java Class is as follows,
import java.io.*;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;
import java.util.Date;
The function i used to check for attachments is given below.
public static boolean hasAttachments(Message m) throws java.io.IOException, MessagingException
Boolean hasAttachments = false;
try
// if it is a plain/html text - no attachements
if (m.isMimeType("text/*"))
return hasAttachments;
else if (m.isMimeType("multipart/alternative"))
return hasAttachments;
else if (m.isMimeType("multipart/*"))
Multipart mp = (Multipart)m.getContent();
if (mp.getCount() > 1)
hasAttachments = true;
return hasAttachments;
catch (Exception e) {
e.printStackTrace();
} finally {
return hasAttachments;
My Java Details as follows
java Version :1.5.0_10
java.vm.specification.version:1.0
java.vm.version :1.5.0_01
java.specification.version:1.5
java.class.version:48.0
Java mail API:javamail-1.4.4
Used Jars:mail.jar
Could someone explain why I am getting this error? What can I do to resolve this error?
Is any other Jar need other than mail.jar?
Any help would be much appreciated.
Regards,
Nisanth889509 wrote:
This java class has no error.Then it should work - not only at compile time, but at run-time too.
Because it does not, it means there are errors. And as the error you've posted is not an Oracle SQL or PL/SQL error, your question is off-topic to this forum.
Why would the code not work at run-time? Numerous reasons, including environmental ones. Java inside Oracle are subjected to a number of restrictions and limitations that do not exist in a Java VM outside Oracle (for good reasons).
So you need to consider that too - and that is why I referred you to the documentation... which is IMO mandatory reading for all Oracle developers. -
VBScript to read from Excel, search AD and put a value back into Excel
I have an Excel spreadsheet that contains a list of hired and terminated Employees. What I would like to do is take the employeeid from only the terminated employees, search AD, and return whether the account is locked/unlocked, disabled/enable, distinguishedName
and expiration date.
So far, it all works until after "Do Until objExcel.Cells(intRow, 1).Value = """. If I comment out "on error resume next", the script never responds with "Wscript.Echo objRS.Fields("distinguishedName")".
I've also tried "Wscript.Echo objRS.Fields("distinguishedName").Value", and that also produces an error (Item cannot be found in the collection corresponding to the requested name or ordinal).
Any assistance to get my script working would be greatly appreciated!
Const ADS_SCOPE_SUBTREE = 2
Const ADS_UF_ACCOUNTDISABLE = 2
On Error Resume Next
' Get the domain string ("dc=domain, dc=local")
strDomain = GetObject("LDAP://rootDSE").Get("defaultNamingContext")
' ADODB connection to AD
Set objConnection = CreateObject("ADODB.Connection")
' Connect
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Cache Results") = False
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim shell : Set shell = CreateObject("Shell.Application")
Dim file : Set file = shell.BrowseForFolder(0, "Choose a file:", &H4000)
strTermString = "Termed"
strFilePath = objFSO.GetParentFolderName(strFile)
strFileName = objFSO.GetFileName(strFile)
Set objFile = objFSO.GetFile(strFile)
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(strFile)
Set objWorksheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objWorksheet.UsedRange
Set objTarget = objRange.Find(strTermString)
If Not objTarget Is Nothing Then
WScript.Echo objTarget.AddressLocal(False,False)
strRowStart = objTarget.Row
strFirstAddress = objTarget.AddressLocal(False,False)
End If
Do Until (objTarget Is Nothing)
Set objTarget = objRange.FindNext(objTarget)
strHolder = objTarget.AddressLocal(False,False)
If strHolder = strFirstAddress Then
Exit Do
End If
WScript.Echo objTarget.AddressLocal(False,False)
Loop
'objExcel.Visible = True
' add one or else we search for termed
intRow = strRowStart + 1
intCol = 1
intID = 0
Do Until objExcel.Cells(intRow, 1).Value = ""
strEmployeeID = objExcel.Cells(intRow,intCol)
WScript.Echo strEmployeeID
objCommand.CommandText = "SELECT * FROM 'LDAP://" & strDomain & "' WHERE employeeid = '" & strEmployeeID & "' AND objectClass = 'user'"
Set objRS = objCommand.Execute
While Not objRS.EOF
intUAC=objRecordset.Fields("userAccountControl")
Wscript.Echo objRS.Fields("distinguishedName")
If intUAC AND ADS_UF_ACCOUNTDISABLE Then
objExcel.Cells(intRow, 20) = "Disabled"
objExcel.Cells(intRow, 1).EntireRow.interior.ColorIndex = 4
End If
Wend
intRow = intRow + 1
LoopA good part of you script makes no sense. YOu are opening the file as a text file and as a spreadsheet. Why?
You have at least two distinct issues:
1. Get information from Excel
2. Check information in AD.
I recommend creating and testing separate steps for thes then combine them when you understand how to make this work.
Here is a way to simplify and debug. After you get the |Excel navigatiuon fixed then uncomment the AD function code.
I have no idea what the first few bits of code are attempting to do since we have no idea what you spreadsheet looks like.,
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(strFile)
Set objWorksheet = objExcel.ActiveWorkbook.Worksheets(1)
Set objRange = objWorksheet.UsedRange
Set objTarget = objRange.Find(strTermString)
If Not objTarget Is Nothing Then
WScript.Echo objTarget.AddressLocal(False,False)
strRowStart = objTarget.Row
strFirstAddress = objTarget.AddressLocal(False,False)
End If
Do Until (objTarget Is Nothing)
Set objTarget = objRange.FindNext(objTarget)
strHolder = objTarget.AddressLocal(False,False)
If strHolder = strFirstAddress Then
Exit Do
End If
WScript.Echo objTarget.AddressLocal(False,False)
Loop
intRow = strRowStart + 1
intCol = 1
Do Until objExcel.Cells(intRow, 1).Value = ""
strEmployeeID = objExcel.Cells(intRow,intCol)
WScript.Echo strEmployeeID
Set objRS = objCommand.Execute
While Not objRS.EOF
WScript.Echo strEmployeeID
'If CheckIfUserDisabled(strEmployeeID) Then
' objExcel.Cells(intRow, 20) = "Disabled"
'objExcel.Cells(intRow, 1).EntireRow.interior.ColorIndex = 4
' End IfIf
Wend
intRow = intRow + 1
Loop
Function CheckIfUserDisabled(strEmployeeID)
Const ADS_UF_ACCOUNTDISABLE = 2
strDomain = GetObject("LDAP://rootDSE").Get("defaultNamingContext")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set rs = objConnection.Execute( "SELECT * FROM 'LDAP://" & strDomain & "' WHERE employeeid = '" & strEmployeeID & "'")
While Not rs.EOF
If rs.objRecordset.Fields("userAccountControl") AND ADS_UF_ACCOUNTDISABLE Then
CheckIfUserDisabled = True
End If
rs.MoveNext
Wend
End Function
¯\_(ツ)_/¯ -
How do I get images from Aperture into print shop for mac?
Friends,
I have Print Shop for Mac and Aperture. How do I get images from Aperture into Print Shop? I'musing managed images with previews. Is there any option besides exporting to the desktop and importing?
Thanks!
Steveif you have previews turned on in Aperture and they're all genereated, you can simply drag-n-drop them into any application (just about). drag-n-drop is essentially the same as copy/paste as long as the application is setup to accept "drops" onto its windows.
otherwise, if you're running Leopard (10.5) as your version of Mac OS X, when you import (or whatever it is in PrintShop), you should get a file selection dialog. from here, scroll down the left-hand side bar set of icons. near the bottom is a group called "Media". click on the triangle to open the group, choose Photos, and from here you should see an Aperture icon. click this and you'll see your whole library (or at least the portion of it that you have previews generated for. select the photo you want and viola!
scott -
How to capture an image from my usb camera and display on my front panel
How to capture an image from my usb camera and display on my front panel
Install NI Vision Acquisition Software and NI IMAQ for USB and open an example.
Christian -
How to upload data from excel to SAP and options to be used
How to upload data from excel to SAP and options to be used
thank you,
Regards,
Jagrut Bharatkumar shuklaHi Jagrut,
You can use gui_upload.
chk the sample program mentioned below.
REPORT ZFTP .
DATA: BEGIN OF I_FILE OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE.
DATA: BEGIN OF I_FILE2 OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE2.
DATA: W_COUNT TYPE I.
PARAMETERS: P_FILEN TYPE STRING,
P_FILE2 TYPE STRING,
P_NUM(4) TYPE N..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILEN.
PERFORM F_FILE_GET USING P_FILEN TEXT-G01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE2.
PERFORM F_FILE_GET USING P_FILE2 TEXT-G01.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = P_FILEN
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = I_FILE
IF SY-SUBRC <> 0.
MESSAGE E024(Z1).
ENDIF.
LOOP AT I_FILE.
W_COUNT = W_COUNT + 1.
IF NOT W_COUNT > P_NUM.
MOVE I_FILE TO I_FILE2.
APPEND I_FILE2.
ENDIF.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = P_FILE2
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = I_FILE2
FIELDNAMES =
*& Form F_FILE_GET
text
-->P_P_FILEN text
-->P_TEXT_G01 text
FORM F_FILE_GET USING L_FILENA L_TEXT.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,*.TXT.'
MODE = 'O'
TITLE = L_TEXT
IMPORTING
FILENAME = L_FILENA
rc =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward if helpful.
Regards,
Harini.S -
I have a new MacBook Air and don't know how to get info from my USB stick and get info from my SD card. Can anyone help, please?
Plug the stick and/or card into the appropriate slots on the side of your Air. Do you see icons for the devices appear on the desktop? Click into them to see what files are there.
Matt -
How can I remove a page from a PDF document and save it as a new PDF document?
How can I remove a page from a PDF document and save it as a new PDF document?
Tools - Pages - Extract and tick the option to delete the extracted page from the original file.
-
Which Version of Adobe do I need to be able to "extract" a page from a existing file and save/download to another file?
Acrobat Pro or Standard.
-
How to capture a .gif file from a spectrum analyzer and save the file in PC
I want to capture a .gif file from a spectrum analyzer and save the file in PC, but I've got a problem when read data from the instrument. I'm not sure how to format the string got from the instrument , When I use "%s" or "%t" as the read string format the data got from the instrument is truncated.
my code are as follows, could anyone tell me where i am wrong?
char resultsArray[5000];
viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%t", resultsArray);
printf("%s", resultsArray);
getchar();
Solved!
Go to Solution.
Attachments:
readResult.docx 50 KBchar resultsArray[5000];
viPrintf(hSpectrumInstr, ":MMEMTORCR 'CICTURE.GIF'\n");
viQueryf(hSpectrumInstr, ":MMEMATA? 'CICTURE.GIF'\n", "%b", resultsArray); -
I want to enlarge an image on a digital photo and save the enlarged image as a seperate photo
I want to enlarge an image on a digital photo and save the enlarged image as a seperate photo
We won’t stop you …
Edit: Actually I’m naturally not entitled to talk for other contributors to this Forum …
Crop (if necessary)
Image > Image Size
File > Save As -
How to download a form from the web, complete and save it?
How to download a form from the web, complete and save it?
Download Adobe Reader. If the form author allows filling out digitally, you can do so and save it again.
Mylenium
Maybe you are looking for
-
Different calculations in the same column.
Hi everyone, Picture a spreadsheet with the following columns: column A is an unique identifier, columns B to G have different sums of money for every unique identifier in A. You are asked to provide a result in column H for every identifier using co
-
Making spool, convert it into PDF and send that PDf throgh EMAIl
Hi, In my making ALV report. In that i want to make the spool and then convert it into the pdf and send mail to the recepient. Atul
-
Difference Between Flash Cs6 on Mac and on Windows.
I have a Mac and I am using Flash Professional Cs6 on it. I will have to use to on a Windows computer soon and i don't know whether it will be the same on that too. Can you please tell me what are differences in Flash Cs6 Mac version and Flash Cs6 Wi
-
Hello everyone, Photoshop CC has recently started beeping whenever I do pretty much anything. Here is a video of the beeping in action. http://www.screenr.com/3h5H The beeping happens when I do any of the following things: Increase canvas size Opened
-
ERROR:Configuration:metaViewFromResourceChanges
After recent installation of our qa box and starting configuration of adapters, etc we are getting error ERROR:Configuration:metaViewFromResourceChanges When we visit the Configure | Identity Attrributes tab. A message indicates resources have change