"Run-time Error '9'" Calling Userform On Some Computers

Feb 5, 2008

I get a "Run-time error '9': subscript out of range" error when calling a userform.
The code opens a reference spreadsheet then shows a userform with a combobox and two command buttons (Continue and Quit). The userform has a private initialization sub-routine to populate the combobox with values from a list on the reference spreadsheet. When the userform is called the error comes up.

Here's my problem: The code was written on my computer and saved as an Add-in. The add-in has since been installed on a number of other computers and works properly. Recently I tried to run the code and this error started popping up, don't know what changed. All versions of Excel are the same and haven't changed.

BRF = ActiveWorkbook.Name
If BRF = "Blank upload.xls" Then
Workbooks.Open path & "QC Data AnalysisQCDA ref.XLS"
OtherBRF.Show
Workbooks("QCDA ref").Close SaveChanges:=False
Goto 1
End If

View 5 Replies


ADVERTISEMENT

Run Time Error When Calling Userform

Jan 16, 2007

I am getting a run time error # 9 when I run a macro that calls a Userform or when I try to run code in a Userform module. The code performs beautifully on my computer, but it did not work on a coworker's computer. It ended up working on 3 out of the 5 computers I have tried it on.

I have tried changing security settings to low, and a bunch of other stuff, but I cannot get the code to run on the computers that get the run time error on them when I try running the code on them.

I get the run time error when I try to load or show any userform in the workbook and I get it if I try to run code that is in the userform module. However, if I paste the code into a regular module and run it, the code runs fine.

Does anyone know what could be causing this? I don't think my code is causing the problem since it runs on some machines, I am guessing there is a setting that is preventing Excel from calling Userforms.

I have a button, Private Sub CommandButton1_Click, on a sheet that shows a userform. This is the bit of code that gets tagged with the run time error. The userform has a refedit control on it allows the user to select a cell and then hit ok to run the code or cancel to, well, cancel it.

Code for the button that gets tagged with the run time error:

Private Sub CommandButton1_Click()
frmLoadTrade.Show 'calls userform
End Sub

Code in the Userform Module:

Private Sub cmdCancel_Click()

TradeTicketSpreadsheetName = ThisWorkbook.Name
Unload Me
Workbooks(TradeTicketSpreadsheetName).Activate

End Sub

View 4 Replies View Related

Error 449: Argument Not Optional Calling UserForm

Dec 5, 2007

I call a userform from a sub menu i created it, but i got an error 449: Argument not optional.

Private Sub Workbook_Open()
Dim cControl As CommandBarPopup
On Error Resume Next 'Just in case
'*Delete existing Super Menu if it was left.
Application. CommandBars.FindControl(Tag:="MyMainMenuTag").Delete
On Error Goto 0
On Error Goto u
'*Add new Accounting Menu
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add(msoControlPopup, 1, , , True)
With cControl...........................

View 7 Replies View Related

Userform Not Working On All Computers

Mar 24, 2009

Private Sub Worksheet_Calculate()
frm_document.Show
End Sub

A userform is called up upon a calculation change in the spreadsheet on two computers and has for years. We just hired a new employee and the userform is not pulling up for her. Instead she gets an error: Runtime error 75...Could not find the specified object.

View 9 Replies View Related

Size UserForm For Different Computers

May 14, 2008

I've created a userform that will be used by multiple users. I'm not finished coding it yet but when I tried to work on it on my computer at home it did not look the same as it did at work. I tried it on several other computers and experienced the same problem.

It appears that the inserted company logo is zoomed in and the some of the label text has wrapped and is not visible.

I've attached a screen shot of the form on my work computer and the way it looks on other computers.

View 5 Replies View Related

Compile Error In Hidden Module On Some Computers

Dec 16, 2006

I have a problem i have written an excel macro in VBA and it is working on some computer but on the others it is not working. It says "compile error in hidden module"

View 3 Replies View Related

Stop Users Changing Computers Time/Date

Aug 31, 2006

I am creating time sheet application , obviously i need to store the time when the user logs & logs out .. The issue is, the user can "Cheat" by changing the system time ...

Any alternatives?? Is it possible to store the time from a particular server etc or some other source.

View 9 Replies View Related

Getting Run Time Error 91 - Stuck With UserForm

Aug 2, 2014

I'm getting a 'Run Time Error 91' saying that 'Object Variable or With Block not set'.

Error lies here:

Code:
Me.lstCategpry.Column = CustRec.GetRows(Fields:=Array("name"))
Userform Initialize:
Code:
Private Sub UserForm_Initialize()

[Code].....

View 4 Replies View Related

Run-time Error 1004 When Trying To Load UserForm

Oct 22, 2008

I included a couple screen prints showing that the form exists, and that it is not misspelled in the code. What should I look for?

View 4 Replies View Related

Clicking Red X On UserForm Produces Run-time Error '91'

Dec 10, 2008

I need to make the Red X at the top firght of my user form "End" rather than "Exit Sub" which I think it is trying to do now, as simply exitting the sub returns it to the previous sub which opens the form again.

View 4 Replies View Related

Calling Variable From Userform

Aug 13, 2007

Hi, i'm having a terrible problem (at least for me).

I want to use a var from a UserForm to use it in calculation method in a Module.
How can i refer to that variable in the Userform in the Module code?

View 11 Replies View Related

424 Error When Calling Into Subroutine?

Nov 17, 2013

I met problem in calling into a subroutine. It is error 424. I have dim all variable. However I still get it.

Code:
Sub UpdateAll()
'
' UpdateAll Macro

[Code]....

I got the error when I pressed F8 to step into the getOneRecord() function, which is highlighted in red.

View 2 Replies View Related

Calling A UserForm From A Command Button

Nov 21, 2009

I can't find anything direct via the web and here so I will ask what will hopefully be an easy question.

I have a form called FIELD_MX and on this form I have a Command Button called Enter ONT Demand Requirements.

When I click the Enter ONT Demand Requirements, I want to display a form called ONT_Demand_Requirements.

I know the UserForm needs to be initialized, but where should it be or am I wrong?

View 9 Replies View Related

UserForm: File/Path Access Error & I/O Error

Dec 19, 2006

the spreadsheet needs to be copied to a directory called "C:downloads" as it contains a ODBC query to itself (In reality, this is a query to an External Oracle Database)

On loading, it should pop up a simple userform, with a combo and two command buttons, which when pressed takes you to a (hidden) tab that displays a pivottable.

All works well until I try to close /save when 60% of the time, Excel encounters problems and closes and will not load up the file the next time until either quit excel or disable macros. Messages include "file/path access error", "I/O Error" or get restarts excel.

On a casual run through, I expect you might report back that "All worked ok for me". Please can you give it a bit of a thrashing, comment out the userform show, save the file (frequently) becuase i assure you it will break ultimately!

This is a brand-new file and I've tried it on about 5 different PC running different versions of Excel and generally get the same result.

View 7 Replies View Related

Run-time Error '91' When 'On Error Goto' And Cells.find

Oct 8, 2008

I have written a Excel (2003) that searches a worksheet for a string in any cell. If the string is not found, it uses the 'On Error GoTo' command to jump to a given label. It works fine on the first string not found. When it searches for the next non-existent string, it fails with:

'Run-time error '91':
Object variable or With block variable not set'

Do I have to clear a buffer after each cells.find search?

My

View 7 Replies View Related

Userform With Time Field Displays Time As Number

Dec 24, 2008

I have a userform that has a time field on it and then the userform displays the time as a number.

Ex. I entered 11:00 AM in the Time of Contact field and the form displays it as 0.458333333333333.

View 10 Replies View Related

Using Userform To Calculate Time To Sheet From Start Time?

Jun 19, 2014

I have a userform that time stamps on my userform as soon as i open the form, is there a way that when I submit, that the amount of time that I was on the call to be put in my column on my worksheet as minutes?

View 2 Replies View Related

Run-time Error Every Other Time The Macro Runs

Oct 10, 2006

I'm not sure why this is happening, but every other time I run this one specific macro, I get a "Run-time error '1004': Paste method of Worksheet class failed". I even tried running this macro, then running a different one, then running this again, but I still got the error every other time.

Every time I get the error, it highlights this line of
Sheets("Regenerate Request").Paste


This is all of the code up to where I get the error:

Sub YesRegen()
' after user has hit Yes on the RegenerateRequest macro, this posts the new request to
' the log, generates the new file and attaches it to an email

Application.Run "LogUnprotect"
Range(Range("A" & ActiveCell.Row), Range("K" & ActiveCell.Row)).Copy
'Selection.Copy
Sheets("Regenerate Request").Activate
Application.Run "RegenFormUnprotect"
Range("A40:K40").Select
Range("A40").Activate
Sheets("Regenerate Request").Paste

View 10 Replies View Related

Date/Time Formula: Pick Up A Date With Time Entry On A Worksheet And Place It Into A TextBox On A UserForm

Jun 17, 2006

I am attempting to pick up a date with time entry on a worksheet and place it into a TextBox on a UserForm. Format on the sheet is mm/dd/yyyy h:mm AM/PM. The UserForm is placing the value as mm/dd/yyyy 12:00 AM. here is the

Private Sub UserForm_Initialize()
If Not Range("dDate").Value = "" Then
TextBox2.Value = Range("dDate").Value
TextBox2.Text = Format(DateValue(TextBox2.Text), "mm/dd/yy h:mm AM/PM")
Else
TextBox2.Value = ""
TextBox2.SetFocus
End If
End Sub


"dDate" is the named range where the date is sitting. The format is also set on the TextBox2 exit event. Can anyone see why only the date portion is being transfered with the default 12:00 AM for no time component of the value?

View 3 Replies View Related

Calendar Not Working On All Computers?

Dec 4, 2013

This is a shared worksheet. When I look at it I can manipulate the calendar, but for others it is just a non-interactive image.

I'm sure this has something to do with them not having this control in their computer, but is there a work around?

View 7 Replies View Related

VBA HTML Not Running On All Computers?

Jul 23, 2014

So I have this code I'm working on for my deptarment that goes to a website inputs data , clicks run and downloads the csv file to the worksheet. It works just fine on my PC and on my profile on the computers the other department uses. We are both using same versions of windows, excel , and IE. When i have someone from the other department run the macro it opens the website but never enters the data into the fields despite the site being the exact same coding as when i'm logged in.

[Code].....

When this code is ran by a member of the other department it just opens the website inputs nothing and doesn't press the RUN button on the website.

What setting or anything. I verified that both PC's VBA references in are there and no "Locations are missing paths" .

View 1 Replies View Related

Collect Data From Different Computers

Dec 30, 2006

I bought 32 laptops out of my own moeny (used) to get my 5th grade students into the 21st century. I have several programs working on these laptops which output data in text and xls files. I would like to either:

1. Poll the files on each workstation at the end of the day and bring the data into excel (I have worked in VBA). Computers are named Comp01 to Comp33.

2. Better: have the workstations save the files to my NAS device so they are on one hard drive.

I would like to keep it simple (I'm a teacher not a good programmer.) Is the "Import External Data" the way to go for the text files? Can a macro go out and loop through the 32 laptops using that or some other add-in?

View 10 Replies View Related

Directory Names On Different Computers

Aug 3, 2009

I have been limited lately to only working on this project at work because I have added a few lines here and there throughout the workbook that make a reference to the directory the file is located in. for example:

View 2 Replies View Related

Save File To 2 Computers

Mar 6, 2007

I have a timesheet I created in Excel. I want to hit a button and have it save on the current computer. I also want it to copy the file to another computer on our network. I would like it to overwrite the exsisting file on this other computer automatically without a message saying "Do you want to overwrite exsisting file". The other computers dir is \OfficeTimesheet

What code can I write to make this happen?

View 9 Replies View Related

Copy Protection :: On Different Computers

Jan 28, 2008

[url]

Private Sub Workbook_Open()
****'** MsgBox Environ("ComputerName")
****If Environ("ComputerName") UCase("Authorized PC Name") Then
********MsgBox "Sorry No Go!" & vbCrLf & "Wrong computer!"
********End
****Else
********'** Do your thing here
********MsgBox "Proceed"
****End If
End Sub

Reading the thread in the link above, It seems as if one could limit access to a workbook. I tried this code on a dummy workbook, I have a few question...

1. Why am I getting "Sorry, No Go. Wrong Computer" when I just put the code in the dummy worksheet for the first time?

2. Can this code be modified to capture my clients computer information to restrict the workbook useage only on one computer and prevent unauthorized distribution to other computers?

3. Can this code run automatically everytime the workbook is open?

View 9 Replies View Related

Allow Use Of Workbook On Specific Computers Only

Jun 6, 2008

I have a workbook with sensitive company information. I need a way to validate the computer the workbook is being opened on and then close the workbook if it is not a confirmed workstation.

The file is already password protected on opening, each worksheet and the workbook is protected, and the VBA code is protected. We just need to take it one step further.

Is there a way to check a registry entry or the computers MAC address on workbook_open?

I have found code to close the workbook without saving which I would use after a message box stating "You do not have permission to access this file."

If someone has their macro security level set to high or very high, that prevents my code from running. How can I make this work on any computer no matter what their macro settings are?

View 9 Replies View Related

Run Time Error 1004 Application-defined Or Object-defined Error

Mar 5, 2013

I have a relatively complex report that I work with and a worksheet is no longer required. I have deleted the worksheet and reference to it hwoever when running the macro to pull all the data, it gets to the summary of all the data and i get the Run Time Error 1004 Application-defined or object-defined error pop up. ON reviewing it, it is on this line ActiveCell.Offset(0, 0).Range("a1:a" & Range_Height).Select of the below code...

VB:
Sub GetRangeName()
Sheets("TOTAL").Select

[Code].....

use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window.

View 1 Replies View Related

Run Time Error 1004 (application-defined Or Object-defined Error)..

Apr 26, 2009

I have a simple function below to put in different forumlas in different cells to get stock quotes. When I run this I get runtime error 1004 application-defined or object-defined error. The first formula goes through but vba chokes on the next formula: ActiveCell.Offset(I - 1, 4).Formula = username

View 10 Replies View Related

Run-time Error '1004' Application-defined Or Object-defined Error

Aug 12, 2009

Run-time error '1004' Application-defined or object-defined error. I am trying to use this

View 2 Replies View Related

Run Time Error 1004 - Application-Defined Or Object Defined Error

Oct 4, 2009

I was trying to use the below code

View 4 Replies View Related







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