ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't run macro as normal user (https://www.excelbanter.com/excel-programming/383298-re-cant-run-macro-normal-user.html)

Henrik Christiansen

Can't run macro as normal user
 
Hi Joel

Hmm.. it does'nt seem like that. When we get the error message I click on
the "debug" button:

The code looks like this:

Sub LaunchMainForm()
Dim objF As frmObjectives

If giNumberOfOpenForms < 0 Then giNumberOfOpenForms = 0

If giNumberOfOpenForms = 0 Then
Set objF = New frmObjectives <- Error on this line, frmObjectives is a
userform
objF.Show False
Set objF = Nothing
End If
End Sub

/Henrik


"Joel" wrote:

The macro is probably access some files that she doesn't have permission to
access. Open up the visual basic editor under the tools macro window. the
program should stop when it gets to the errror. Move the mouse over the
different variables to see what file name has the problem.

"Henrik Christiansen" wrote:

Hi all

I have this odd problem. One of our users can't run a macro in a Excel XP
spreadsheet. She's getting an Run-time error '1004' Application-defined or
object-defined error. When I log on with my administrative account on the
same Pc the macro runs fine.

What could be the cause of that?

Kind Regards
Henrik


merjet

Can't run macro as normal user
 
The problem is probably this line:
Dim objF As frmObjectives

It should be: Dim objF As UserForm
or: Dim objF As Object

Hth,
Merjet



All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com