Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6004831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:19:06+00:00 2026-05-23T01:19:06+00:00

Public Sub EdgeColor_Click() Dim intInFile As Integer intInFile = FreeFile Open c:\picturename.csv For Output

  • 0
Public Sub EdgeColor_Click()
    Dim intInFile As Integer
    intInFile = FreeFile

    Open "c:\picturename.csv" For Output As #intFileNo
    Print #intFileNo, "test"

    Close #intFileNo
End Sub

This is my code, and I get Run-time error 52 ‘bad file name or number’. I’ve tried doing as Input and making the file exist but I get the same error.

This is VBA inside of a Proficy iFix graphic, and can’t for the life of me figure out what I am doing wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T01:19:06+00:00Added an answer on May 23, 2026 at 1:19 am

    You’re mixing up intInFile and intFileNo.

    It’s possible that intFileNo is simply set to zero if you’re not using the option explicit command, which may explain the invalid number.

    That little command goes at the top of every one of my VB/VBA files because I’ve been burnt by this so many time before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How would I test the following code? Public Sub SetSerialIdForDevice() Try Dim component As
Public Enum Fruit Red_Apple = 1 Oranges Ripe_Banana End Enum Private Sub InitCombosRegular() Dim
I have a Class FileDoc Public Class FileDoc Inherits BaseClass Public Sub DeleteDoc() dim
For example: Public Class Class1 Public Sub Some() Dim Image As New Bitmap(C:\image.bmp) End
I use this code to share folder: Public Sub Share() Dim managementClass As New
Public Sub cleanTables(ByVal prOKDel As Short) Dim sqlParams(1) As SqlParameter Dim sqlProcName As String
Consider the following example: Public Class ParentClass Public Sub GenerateReport Dim Col As Collection
Dim conn As OleDbConnection Dim cmd As OleDbCommand Public Sub openDB() conn = New
I have the following Public Structure Foo dim i as integer End Structure Public
Public Sub WriteTextFile(ByVal SourceToWrite As String, ByVal LocationToWrite As String) Dim file As System.IO.StreamWriter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.