Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How to open .jpg picture using Macro

I use the following macro to open excel files. Can this be modified to open
a picture ppppp.jpg ?

. . . or, can someone help me with a new macro that can open pictures
. . . I would still like to have the file checking options to see if already
open and if file actually exists.

Thanks
Matt @ Launchnet

Sub NewExcelWithWorkbookFantastic()
Dim oXL As Object 'This is needed to open a new instance of Excel.
'Without it, the file is only opened as a new Window
Dim testFileFind
Dim oWB As Object

If FileAlreadyOpen("c:\extrafiles\fantastic.xls") = True Then
MsgBox "File is alreaady open"

End
Else

'The following tests for the existance of the file
testFileFind = Dir("c:\extrafiles\fantastic.xls")

'If the file is not found there will be nothing
'in the variable and processing ends.
If Len(testFileFind) = 0 Then
MsgBox "You do not have this file in C:\extrafiles\"
End
End If

'THIS LINE OF CODE OPENS THE NEW INSTANCE OF EXCEL.
Set oXL = CreateObject("Excel.Application")

'THIS LINE OF CODE MAKES THE NEW INSTANCE OF EXCEL VISIBLE.
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("c:\extrafiles\fantastic.xls")

End If
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200902/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default How to open .jpg picture using Macro

Open the picture where? In a worksheet? In a UserForm? In an Image control?
Somewhere else?

--
Rick (MVP - Excel)


"Launchnet" <u20911@uwe wrote in message news:92253dcfafcae@uwe...
I use the following macro to open excel files. Can this be modified to
open
a picture ppppp.jpg ?

. . or, can someone help me with a new macro that can open pictures
. . I would still like to have the file checking options to see if already
open and if file actually exists.

Thanks
Matt @ Launchnet

Sub NewExcelWithWorkbookFantastic()
Dim oXL As Object 'This is needed to open a new instance of Excel.
'Without it, the file is only opened as a new Window
Dim testFileFind
Dim oWB As Object

If FileAlreadyOpen("c:\extrafiles\fantastic.xls") = True Then
MsgBox "File is alreaady open"

End
Else

'The following tests for the existance of the file
testFileFind = Dir("c:\extrafiles\fantastic.xls")

'If the file is not found there will be nothing
'in the variable and processing ends.
If Len(testFileFind) = 0 Then
MsgBox "You do not have this file in C:\extrafiles\"
End
End If

'THIS LINE OF CODE OPENS THE NEW INSTANCE OF EXCEL.
Set oXL = CreateObject("Excel.Application")

'THIS LINE OF CODE MAKES THE NEW INSTANCE OF EXCEL VISIBLE.
oXL.Visible = True
Set oWB = oXL.Workbooks.Open("c:\extrafiles\fantastic.xls")

End If
End Sub

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200902/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default How to open .jpg picture using Macro

Hi Rick
I just wanted the picture to be displayed (not in any program).
It is solved. Thanks for replying.
Matt @ Launchnet

Rick Rothstein wrote:
Open the picture where? In a worksheet? In a UserForm? In an Image control?
Somewhere else?

I use the following macro to open excel files. Can this be modified to
open

[quoted text clipped - 38 lines]
End If
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200902/1

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to open a picture with a link RD Excel Worksheet Functions 2 February 29th 08 03:30 PM
how do i open a picture file by clicking on a certain cell? amroshious Excel Programming 2 August 3rd 06 09:15 PM
Open a picture based on Excel Value tdawg79 Excel Programming 2 February 27th 06 09:21 PM
open gif with picture and fax viewer from Excel Mjski Excel Discussion (Misc queries) 0 February 23rd 05 11:53 PM
how to know the picture is open Dorothy Lo Excel Programming 1 January 18th 05 01:37 AM


All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"