Modules & VBA :: Shell Picture Viewer Command Opens Minimized?

Aug 13, 2015

I'm having trouble with a shell() command in my vba.

I'm trying to call up the picture viewer showing the file of the photo I clicked on in a form. Everything is happening as expected - the file opens in Windows Photo Viewer, but it is minimized.

I can open a picture fine from Windows Explorer, but something about my shell command is forcing a minimize.

Here is my code:

Code:
Dim sFile As String
PicFile = "C:Pics" & Me!PicName & ".jpg"
Shell "RunDLL32.exe C:WindowsSystem32Shimgvw.dll,ImageView_Fullscreen " & PicFile

I would have assumed ImageView_Fullscreen would do what I want!

View Replies


ADVERTISEMENT

Modules & VBA :: SHELL Command Always Opens The Folder Minimized

Sep 30, 2013

I'm trying to use this command:

Code:
Shell "C:WINDOWSexplorer.exe """ & Me.txtSource & """, VbMaximizedFocus"

to open a folder from within Access 2007 & Windows7. It works, but it always opens the folder minimised, whether I use VbMaximizedFocus or VbNormalFocus. It used to work properly in Access 2003 & WinXP.

View 2 Replies View Related

DB Opens Minimized

Apr 11, 2006

It has been ages since I visited the forum, feb 23 to be more exact...
Life has been hell and am crammed for time... This time I have run into something I cannot get a handle on...

On just about any PC this db I build works perfectly, but on one I having some trouble (see attached). I have never experience this.

If I (or the customer) opens the database either by double clicking on the database on the network, double clicking the shortcut it looks like [see attachments OnOpen]

This is not very nice offcourse but is simply solved by clicking the maximize button. After which we see this... [see attachments AfterMax]

From this I can maximize the database screen, but not the form. It stays like that, unless I click design and then Form view. After which the database works normal.

Does anyone have any clue?

View 1 Replies View Related

Modules & VBA :: Shell Command Not Working With Spaces In File Name

Oct 21, 2013

I am in trouble with the shell ocmmand,i have a text box "ExcelPath Location" in which there is a path of excel file i am using below code to open the excel file but it gives an error:

Code:

Private Sub Command11_Click()
Dim str As String
str = ExcelPathLocation.Value
strPath = Dir(str)
Shell "excel.exe" & """" & strPath & """", vbNormalFocus
End Sub

the value of text box is

O:QA FilesQC ReportingPending ReviewB329129)419479_BoxPort_RAMANDEEP BRAR_(10192013.xlsm

it gives run time error : 53 file not found.

View 3 Replies View Related

Modules & VBA :: Invalid Procedure Call Or Argument Using Shell Command?

Feb 6, 2015

I'm developing an application where I want to call the keyboard up on the screen when a user enters a field. This is my setup:

Windows 8.1 32 Bit, Access Runtime 2010.
Exact lines of code are:

Dim RetVal
RetVal = Shell("C:Program FilesCommon Filesmicrosoft sharedinkTabTip.exe")

These lines of code work perfectly fine on my development PC which is running Windows 7 64 bit, Access/Office 32 bit.

I know the path to the exe is good. I can navigate and double click it and it works great. but the shell command is resulting in the invalid procedure.

View 4 Replies View Related

Shell Command..sychronous/Asynchronous

Oct 4, 2006

Hi everyone

I searched the forum for help..but couldnt find what I am looking for.

I want to run a batch file using shell cmd and wait for it to complete..until then I want to display a hourglass...because my next line of code needs the batch file run completed.

Right now, shell command starts the batch file then continutes to the next line of code..Tried the Doevents does not work right.

Access help states that :
"By default, the Shell function runs other programs asynchronously. "

How can I make it synchronous?



Thanks in advance for the help.

View 1 Replies View Related

Forms :: Command Button - Form Opens To New Record But Not Specific One

Jul 2, 2013

I have a form that opens from a different form based on the primary key within the original form. Unfortunately it seems to be opening a new record every time I open the form--not only from the original form but also straight from the sidebar.

The command button that opens the second form from the first uses the following VBA:

DoCmd.OpenForm "ZooMobile Incomplete Booking-Return Client", , , "[Event_ID] = " & Me.EventID

This exact coding worded perfectly in a similar set of forms that I had created; the only difference is a change in the form name & primary key field.

Add onto this, I think that the code DOES work, but then it immediately opens another new record. When I open the second form from the command button, then change to Design View, the form's Filter property is set to [Event_ID]=X (where X is the proper key from the first form) and Filter On Load is set to Yes. The X in the Filter changes accordingly when it changes in the first form. Also, every time I open the form a new record is added to the underlying table.

I've tried setting "Allow Additions" in the second form to No, but then when I open the form nothing appears. Literally; the entire form is blank, no labels, textboxes, combos, buttons or anything. When going to Design View it's still all there.

I've also checked the On_Load, On_Current & Form_Current events and found nothing. I even deleted them and the problem still occurred.

View 4 Replies View Related

General :: Command Button To Insert Picture In Form

Nov 17, 2012

In form I want to put a command where we can browse a picture and insert it...how to do ...

View 5 Replies View Related

Modules & VBA :: Shell - How To Direct To A File

Jun 24, 2013

I use shell to run .exe file eg 7za.exe. How can i direct the output to a text file.

The following don't seem to work

shell "7za.exe > " & chr(34) & "c:log.txt" & chr(34)

or

shell "7za.exe > c:log.txt"

Problem has nothing to do with wait to complete process.

how to direct out to a file via VB.

View 3 Replies View Related

Modules & VBA :: Opening File Using Shell / CPAU

May 27, 2015

I want to open files from a networklocation from VBA, only normal users don't have access to that location (and should preferably not get it).

I instead of using shell("explorer.exe filepath") to open files using windows standard app for the file, which needs userpermissions to the path the file is located, for the currently logged in user.

I'm trying to use CPAU in combination with Shell, because using CPAU you can pass a user/password that has permission to open a process

The only problem is that the filepaths have spaces in them and that is Always a bit of a tricky thing to tackle.

So, for example, this works:

shell("N:GuidelineOntwCPAU -u DomainUser -p password -LWOP -ex " &
Chr(34) & "C:windowsExplorer.exe c: emp est.pdf")

But I cannot get it to work with a file that is on a path with a space in it (or with a space in the name), like

Code : N:EngineeringJB-MATBBBB-004_Panel PinBB-004_Panel Pin.pdf

I'm trying all kinds of thinks:

- adding chr(34) at certain places
- using """
- the above in different versions

But to this point without result.

Trying to figure out the plain cmdline:

Code:
N:GuidelineOntw10_Ontwcpau -u Domain/User -p Password -ex "c:windowsExplorer.exe "c: emp est.pdf""

Doesn't work:

Code:
N:GuidelineOntw10_Ontwcpau -u Domain/User -p Password -ex "c:windowsExplorer.exe "c: emp est 1.pdf""

(difference in filename with a space in it)

The last command start explorer, but doesn't open the file (just as the first line I posted, it opens Explorer, but not the file. Must be something with the way I pass the filename?)

Code : explorer.exe "C: emp est 1.pdf"

Also works in commandline...

View 4 Replies View Related

Modules & VBA :: Shell Function To Open Calculator

Dec 17, 2014

I want to open the Calculator by clicking a command button (using the On Click event).

I have tried the code below but can't get it working. What do I need to change?

Private Sub Command7_Click()
Dim RetVal As Integer
RetVal = Shell("C:Windowscalc.exe", 1)
End Sub

View 2 Replies View Related

Modules & VBA :: Shell And Invalid Procedure Call Or Argument

Feb 23, 2014

I have a form with a button to print preview a report. This report needs one input parameter before executing. The computer this will run on is a touch screen and does not have a keyboard. Windows 7 has a "on screen keyboard" program. I want this to run first so that my user can input the parameter.

I have the following which throws an "Invalid procedure Call or Argument"

Sub CallTeclado()
Dim RetVal
RetVal = Shell("c:windowssystem32osk.exe", vbNormalNoFocus)
End Sub

View 4 Replies View Related

Modules & VBA :: How To Disable Buttons From Another App Which Is Called By Shell Execute

Sep 30, 2013

I'm using shellexecute in my form whenever a picture is clicked the respective program/ application will open to show the picture. Because I want to see the picture more clearly by zooming it in or out. But the problem is I don't know how to disable the delete button and prev./next button, because I want the user use the program only to zoom it in.

View 4 Replies View Related

Modules & VBA :: GetElementByID With Internet Explorer Using Shell Windows

Jul 16, 2013

I can currently open a new internet explorer instance, navigate to my URL, then use the .getElementByID to insert my preference into a textbox on the page. Looks like this:

Code:
Dim oIE As Object
Set oIE = CreateObject("InternetExplorer.Application")
oIE.Navigate "URL of my Choice"
Do While oIE.Busy Or oIE.ReadyState <> READYSTATE_COMPLETE
DoEvents

[Code] ....

View 7 Replies View Related

Modules & VBA :: Using Shell Function To Dynamically Call Different Pdfs That Are In A Directory?

Aug 13, 2013

I'm looking to use the shell function to dynamically call different pdfs that are in a directory. However I'm getting run time error 5 "Invalid procedure or call argument".

Here is the code (very basic I know)..

Private Sub Liste_Documentation_DblClick(Cancel As Integer)
Dim PathName As String
PathName = Me.Liste_Documentation.Column(2)
' Debug.Print PathName
Shell PathName
End Sub

A typical filepath name is as follows..

S:VenteVendeursMarcCRMDOCSDiligences KYC - LABFT - V 2013 04 23.pdf

View 8 Replies View Related

Form Opens When Database Opens

Aug 16, 2007

How can I get a form to open when the database opens?

View 5 Replies View Related

Modules & VBA :: Record Data When A Form Opens

Feb 11, 2015

I'm trying to add data about a form to a table when the On_Current event fires. The data I want to add is:
windows login username

date and time the On_Current event occurred
name of the form that was opened
that the form was opened
the number of the record (ID) in the table the form is based on

I have the following code

Private Sub Form_Current()
If Me.NewRecord Then
Call FlimOpen("OR IR No", "OPENED")
Else
Call FlimOpen("OR IR No", "OPENED")

[Code] ....

Excuse the use of 'FlimOpen' but I needed a unique word that I would remember (inspired by FlimFlam the cat on the children's channel CBeebies here in the UK)

I try to compile and I get an error about the wrong number of arguments or invalid property assignment. However, the event does fire correctly when I open the form or move from one record to another so something's working!

View 1 Replies View Related

Modules & VBA :: Hide Subform When Main Form Opens

Jan 9, 2015

I need to hide my subform on load or open of the main form but am experiencing some weird results. I have tried putting Me.SubForm.Form.Visible = False in both the on open and the on load of the main form and it works only if the tables on which the subform have records in them. If the tables for the subforms are empty I get an error 2467 telling me that "The expression you entered refers to an object that is closed or doesn't exist." I find this strange because from all I can find the subform loads first.

How can I hide the subform when the main form opens no matter what records exist or don't?

View 6 Replies View Related

Modules & VBA :: Form Stays In Front When Table Opens

Jul 6, 2014

I have a Form with a control button that opens a Table using VBA code.

I have made quite a few similar databases before and usually when the Table opens it opens "above' or in front of the Form.

This time the Table opens but behind the Form.

I would like the Table to open and appear in front of the Form.

Is there a setting or something to control which displays on top?

View 2 Replies View Related

Modules & VBA :: Static Shell Function Call Works But Dynamic Call Fails

Sep 4, 2013

I'm having to recode some old MS Access DBs so they will run in the following environments:

Office 2000 on WinXP
Office 2003 on WinXP
Office 2010 on WinXP
Office 2000 on Win7
Office 2003 on Win7
Office 2010 on Win7

When I wrote my code for Office 2000 on WinXP things were simple because directory paths were the same across all computers and I could hard code pathing when using a shell command to launch other files.

My new approach is to make a function call to the Windows registry to determine the default executable and path for opening a file based upon its extension (see apicFindExecutable in basWindows API module).

I'm able to use code to create a shell call and debug print it to the immediate window. If I put my cursor in the immediate window at the end of the shell call and hit [enter] the external file will open as desired. If I try to open the external file directly through code, I get a file not found error.

To recreate the error take the following steps:

(1) browse to files that are accessible from your computer
(2) click the PREPARE DATA AND OPEN MAIL MERGE DOCUMENTS command button

Shell function call is made by the fnOpenFile function located in the basOpenFile module. There has to be a trick here that I'm missing.

View 5 Replies View Related

Modules & VBA :: Excel File Opens And Code Stops Execution

Nov 12, 2014

I'me running on Win7, Office 2010, Acc2003 format (.mdb), writing data to Excel 2010 (.xlsx)I have code to create an Excel file, send record set data to it, and then add some formulas and formatting. I was trying to tune up the formulas, when I got a pull back:Access VBA code suddenly stops running, and the file gets displayed in Excel

Code:
'ApXl is Application.Excel
'xlWSh is the Excel WorkSheet
'rst is my DAO.Recorset

[code]...

The same happens when I have ApXl.Visible = True

View 10 Replies View Related

Modules & VBA :: Displaying Picture From Imagelist

Jul 8, 2014

I want to display a picture (or pictures) from Imagelist in the picturebox (KIBES_picture).But I am getting a type mismatch error in the last line. What am I doing wrong?

Code:
Public Sub load_picture()
Dim iml As ImageList
Set iml = New ImageList
iml.ListImages.Add , , LoadPicture("K:Kapa-Planung ElektrikKibes_DatabaseAufbausystemme2_Innenbeleuchtung.00000-0002_Treppebeleuchtung_ueber_2 Schalters_087A00ekran_edycja.jpg")
[Forms]![Search]![KIBES_picture].Picture = iml.ListImages(1)

Besides, when I have Listimage(0) I am getting an other error: Index out of bounds. Strange, because the index should start from zero?

View 1 Replies View Related

Modules & VBA :: Embedding A Picture Into Email

Sep 24, 2014

I am trying to embed a picture in an email, code below:

Code:
Dim MyOutlook As Object
Dim MyMail As Object
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)

[Code] ....

View 3 Replies View Related

Modules & VBA :: Insert Picture In SQL Using Button

Oct 4, 2014

I use the botton code for save image in SQL

Dim fDialog As Object
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Set Cn = New ADODB.Connection
Cn.Open "Provider=SQLOLEDB;data Source=.;" & _
[Code] ....

But I have a problem when my database more than 2000 record. I think my problem in

rs.Open "Select * from Table_2", Cn, adOpenKeyset, adLockOptimistic

because select all record in Table_2

I decided to use bottom code

strSQL = "INSERT INTO Table_2(image_v,sabt,filetype_v,imageid) Values (mstream.Read,'" & [kodimage] & "','" & [file_type] & "','" & Me.Text8 & "');"
Cnxn.Execute strSQL

But I get an error with mstream.Read!!!!

View 3 Replies View Related

Modules & VBA :: Form With Textbox With LinkedIn Profile Address - Hyperlink Opens Twice

Jul 1, 2015

I have a form with a textbox with the "LinkedIn" profile address that I want the user to be able to pull up when they click a command button. It works, except that the link opens twice in two tabs in the browser. I've checked over the code for the whole form, and this code is only being run from the click event of the button, so why would it open the same tab twice? Here's the code:

Private Sub cmd_Click()
Dim ctl As CommandButton
Dim txthyper As String
Set ctl = Me!cmd
txthyper = Me!LinkedIn

[code]....

View 3 Replies View Related

Modules & VBA :: ImageFrame To Open As A Picture Using Wildcard

Jan 29, 2014

I want to my ImageFrame to open as a picture. My problem is that my picture could be either a .jpg or a .png (or whatever). The code below works if I hard code profile_pic.png or profile_pic.jpg. Is there a way to use the wildcard here? (Its not working as written now)

Code:

Dim vFolderPath As String, strFile As String, dirFile As String
vFolderPath = DLookup("FolderName", "tblCodes-FolderControl", "FolderKey = '" & "Profile" & "'")
dirFile = Dir(vFolderPath & ctrl_people_id & " *", vbDirectory)
strFile = "profile_pic." + "*"

[code]...

View 8 Replies View Related







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