Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in executing Excel-VBA when running on another PC 1

Status
Not open for further replies.

LangAdel

Technical User
Oct 28, 2003
11
DK
I have tool in Excel 2000, which can run a quesionaire in forms. One file has been made as a "administrative" tool where all questions are kept, and another file to run the questionaire.
Problem: When running the files on my own PC everything works out fine, but when trying to run them on other PC some of the macros do not work, which makes the tool useless.
The VBA project is protected with a code. (I do not believe that is the problem)
No part of the code is in my Personal.xls either.

One of the problems seems to be when the macros activate dialog box.
E.g. when running this code it stops in line 1.:

Sub importquest()
'
' importquest Macro
' Macro recorded 20-08-2003 by DKBRG
'Benyttes af administrator til import af udvalgte spørgsmål fra administrator
'værktøjet

myfile = Application.GetOpenFilename("xls files,*.xls")
Workbooks.Open Filename:=myfile
Sheets("Udvalgte").Select

Any help appreciated

regards Brian
 
Looking at your code, you've not defined your
Code:
myFile
variable.

Before this line, try adding
Code:
Dim myFile As String
and see if that works.



Leigh Moore
Solutions 4 MS Office Ltd
 
Hi Leigh

Thanks for your reply. Error message "error in hidden module".
Myfile is being defined in the first line. Like I wrote it works on my own PC
Brian
 
Hi Leigh

Your advise to Dim myFile As String actually solved the problem. Allthough I still dont understand why it works on my PC and not some of the others.

Thanks
Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top