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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does not recognize file type? Missing addin?

Status
Not open for further replies.

kalebson

Programmer
Mar 3, 2006
60
US
My code started like this and would not run:

Workbooks("Staffing Model").Worksheets("Data").Range("f1") = lastupdated + 1

However when I added the extension it worked like so:

Workbooks("Staffing Model.xls").Worksheets("Data").Range("f1") = lastupdated + 1

I dont remember having to have the extension in my previous code. Did I maybe turn something off?
 
Unless your workbook has no extension, this will fail:
Code:
Workbooks("Staffing Model").Worksheets("Data").Range("f1") = lastupdated + 1
as you have seen. Even if the behavior was tied to a user-changable option, I'd opt for the approach guaranteed to work regardless of environment.


Regards,
Mike
 
I will essentially have to change all my code as this is a new issue that I did not previously encounter running any of my code. Now unless I add the extension to ALL of my code none of them want to run.
 
Some additional info that I just discovered: Your original construct
Code:
Workbooks("Staffing Model").Worksheets("Data").Range("f1") = lastupdated + 1
will work if you have told Windows to hide file extensions for known file types

I'll leave it to you whether to change this setting (via Windows Explorer) or your code.


Regards,
Mike
 
That is it....I just looked and that was UNchecked..thx a ton.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top